You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ChadDavis <ch...@gmail.com> on 2009/11/20 22:36:49 UTC
JCR-RMI, SPI, WEBDAV, and Sling's REST
I'm having a hard time sorting out deployment information from the web
site. In perusing the mailing list, I find people recommending WEBDAV
or Sling as alternatives to JCR-RMI for remote communication with the
repository.
I'm confused by this. Basically, I want a reference to the Repository
object so I can code against the JCR API. How, then, are these HTTP,
and other higher level protocols, seen as alternatives?
I want to know what my options are for deploying jackrabbit in it's
own JVM, then connecting to it and coding agains the JCR API. Does
SPI provide this? Surely, I can't get this from WEBDAV or Sling, can
I?
Thanks.
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by ChadDavis <ch...@gmail.com>.
Thanks for your help. I have another question below.
>>> The TransientRepository is not a tutorial-type thing, it's to be used
>>> when you want to run Jackrabbit in your standalone application.
>>>
>>
>> It says that it destroys the repository when the last session expires,
>> then recreates the repo when another new session arises . . . this
>> seems kind of like a huge performance hit. Maybe I'm
>> misunderstanding?
>
> That's an optimization, the underlying repository is the same. You can
> either keep one session open (for example for admin tasks or
> observation) or simply use the RepositoryImpl directly.
>
To clarify, you are saying that I need to keep a dummy session open to
avoid the overhead of repeated repository deletion and creation?
Also, I read another older post where someone suggests that the
TransientRepository is more appropriate from embedded deployments,
[1] and not remoting. Is this accurate?
[1] http://markmail.org/search/?q=jackrabbit%20transient%20repository#query:jackrabbit%20transient%20repository+page:14+mid:575x4k3ausqsoezo+state:results
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Nov 24, 2009 at 19:53, ChadDavis <ch...@gmail.com> wrote:
>> The TransientRepository is not a tutorial-type thing, it's to be used
>> when you want to run Jackrabbit in your standalone application.
>>
>
> It says that it destroys the repository when the last session expires,
> then recreates the repo when another new session arises . . . this
> seems kind of like a huge performance hit. Maybe I'm
> misunderstanding?
That's an optimization, the underlying repository is the same. You can
either keep one session open (for example for admin tasks or
observation) or simply use the RepositoryImpl directly.
BTW, for using spi2davex I wrote some info in another mail thread:
http://markmail.org/message/nzcbrf27b2edkbzr
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by François Cassistat <f...@maya-systems.com>.
What's seems to make the JackRabbit RMI layer a little slow is that all jackrabbit operation on session, node, etc. are passing by RMI and wait for the client to tell the next operation to do. (This may be acceptable in certain cases, I think it is a great option since it is really easy to set up.)
But since JackRabbit 2.0 does not support the RMI layer (yet), I am working on my own RMI interface to discuss with my JCR utility functions I use in my project. I expect it should give better performances since all nodes/session/properties operations and lazy iterations will be made directly by the server.
If you succeed to separate the JCR operations from the of your project to add your own RMI interface, it will make your code more modular and more JCR-independent.
Frank
Le 2009-11-24 à 1:53 PM, ChadDavis a écrit :
> On Tue, Nov 24, 2009 at 1:05 AM, Alexander Klimetschek <ak...@day.com> wrote:
>> On Mon, Nov 23, 2009 at 22:53, ChadDavis <ch...@gmail.com> wrote:
>>> On Mon, Nov 23, 2009 at 2:49 PM, Dave Brosius <db...@mebigfatguy.com> wrote:
>>>> Perhaps you are interested in this?
>>>>
>>>> http://jackrabbit.apache.org/jackrabbit-jcr-rmi.html
>>>
>>>
>>> I am interested in that. However, I've read that it's performance is
>>> horrible. Are you familiar with the performance?
>>
>> It is not horrible by default. Depending on your use cases it might be
>> sufficient.
>>
>
> I think I'll use the JCR-RMI remoting for my initial proof of concept,
> architectural testing.
>
>>> Also, in the example code it doesn't show how to properly create a
>>> repository. I did find some slightly more complete code on the WIKI,
>>> but it uses the TransientRepository, which seems like a tutorial only
>>> type thing.
>>
>> The TransientRepository is not a tutorial-type thing, it's to be used
>> when you want to run Jackrabbit in your standalone application.
>>
>
> It says that it destroys the repository when the last session expires,
> then recreates the repo when another new session arises . . . this
> seems kind of like a huge performance hit. Maybe I'm
> misunderstanding?
>
>> For webapp scenarios there is the jackrabbit-webbapplication
>> deployment which includes a servlet that starts up the repository and
>> registers it under JNDI etc. See
>> http://jackrabbit.apache.org/jackrabbit-web-application.html
>>
>> To play around, the standalone server is a good start. See
>> http://jackrabbit.apache.org/standalone-server.html
>>
>> See also http://jackrabbit.apache.org/first-hops.html and
>> http://jackrabbit.apache.org/deployment-models.html
>>
>> Regards,
>> Alex
>>
>> --
>> Alexander Klimetschek
>> alexander.klimetschek@day.com
>>
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by ChadDavis <ch...@gmail.com>.
On Tue, Nov 24, 2009 at 1:05 AM, Alexander Klimetschek <ak...@day.com> wrote:
> On Mon, Nov 23, 2009 at 22:53, ChadDavis <ch...@gmail.com> wrote:
>> On Mon, Nov 23, 2009 at 2:49 PM, Dave Brosius <db...@mebigfatguy.com> wrote:
>>> Perhaps you are interested in this?
>>>
>>> http://jackrabbit.apache.org/jackrabbit-jcr-rmi.html
>>
>>
>> I am interested in that. However, I've read that it's performance is
>> horrible. Are you familiar with the performance?
>
> It is not horrible by default. Depending on your use cases it might be
> sufficient.
>
I think I'll use the JCR-RMI remoting for my initial proof of concept,
architectural testing.
>> Also, in the example code it doesn't show how to properly create a
>> repository. I did find some slightly more complete code on the WIKI,
>> but it uses the TransientRepository, which seems like a tutorial only
>> type thing.
>
> The TransientRepository is not a tutorial-type thing, it's to be used
> when you want to run Jackrabbit in your standalone application.
>
It says that it destroys the repository when the last session expires,
then recreates the repo when another new session arises . . . this
seems kind of like a huge performance hit. Maybe I'm
misunderstanding?
> For webapp scenarios there is the jackrabbit-webbapplication
> deployment which includes a servlet that starts up the repository and
> registers it under JNDI etc. See
> http://jackrabbit.apache.org/jackrabbit-web-application.html
>
> To play around, the standalone server is a good start. See
> http://jackrabbit.apache.org/standalone-server.html
>
> See also http://jackrabbit.apache.org/first-hops.html and
> http://jackrabbit.apache.org/deployment-models.html
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Nov 23, 2009 at 22:53, ChadDavis <ch...@gmail.com> wrote:
> On Mon, Nov 23, 2009 at 2:49 PM, Dave Brosius <db...@mebigfatguy.com> wrote:
>> Perhaps you are interested in this?
>>
>> http://jackrabbit.apache.org/jackrabbit-jcr-rmi.html
>
>
> I am interested in that. However, I've read that it's performance is
> horrible. Are you familiar with the performance?
It is not horrible by default. Depending on your use cases it might be
sufficient.
> Also, in the example code it doesn't show how to properly create a
> repository. I did find some slightly more complete code on the WIKI,
> but it uses the TransientRepository, which seems like a tutorial only
> type thing.
The TransientRepository is not a tutorial-type thing, it's to be used
when you want to run Jackrabbit in your standalone application.
For webapp scenarios there is the jackrabbit-webbapplication
deployment which includes a servlet that starts up the repository and
registers it under JNDI etc. See
http://jackrabbit.apache.org/jackrabbit-web-application.html
To play around, the standalone server is a good start. See
http://jackrabbit.apache.org/standalone-server.html
See also http://jackrabbit.apache.org/first-hops.html and
http://jackrabbit.apache.org/deployment-models.html
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by Dave Brosius <db...@mebigfatguy.com>.
I had it working through rmi, but just to play around with. Don't have a
clue about performance.
ChadDavis wrote:
> On Mon, Nov 23, 2009 at 2:49 PM, Dave Brosius <db...@mebigfatguy.com> wrote:
>
>> Perhaps you are interested in this?
>>
>> http://jackrabbit.apache.org/jackrabbit-jcr-rmi.html
>>
>
>
> I am interested in that. However, I've read that it's performance is
> horrible. Are you familiar with the performance?
>
> Also, in the example code it doesn't show how to properly create a
> repository. I did find some slightly more complete code on the WIKI,
> but it uses the TransientRepository, which seems like a tutorial only
> type thing.
>
>
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by ChadDavis <ch...@gmail.com>.
On Mon, Nov 23, 2009 at 2:49 PM, Dave Brosius <db...@mebigfatguy.com> wrote:
> Perhaps you are interested in this?
>
> http://jackrabbit.apache.org/jackrabbit-jcr-rmi.html
I am interested in that. However, I've read that it's performance is
horrible. Are you familiar with the performance?
Also, in the example code it doesn't show how to properly create a
repository. I did find some slightly more complete code on the WIKI,
but it uses the TransientRepository, which seems like a tutorial only
type thing.
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by Dave Brosius <db...@mebigfatguy.com>.
Perhaps you are interested in this?
http://jackrabbit.apache.org/jackrabbit-jcr-rmi.html
ChadDavis wrote:
> I'm having a hard time sorting out deployment information from the web
> site. In perusing the mailing list, I find people recommending WEBDAV
> or Sling as alternatives to JCR-RMI for remote communication with the
> repository.
>
> I'm confused by this. Basically, I want a reference to the Repository
> object so I can code against the JCR API. How, then, are these HTTP,
> and other higher level protocols, seen as alternatives?
>
> I want to know what my options are for deploying jackrabbit in it's
> own JVM, then connecting to it and coding agains the JCR API. Does
> SPI provide this? Surely, I can't get this from WEBDAV or Sling, can
> I?
>
> Thanks.
>
>
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Nov 23, 2009 at 23:09, ChadDavis <ch...@gmail.com> wrote:
> Depending upon my use case . . . but this is clearly not a use case
> for accessing the JCR API in my application's code, correct?
No, it doesn't provide the full JCR API. But it allows for simple
content creation and access through eg. Ajax clients.
>>> I want to know what my options are for deploying jackrabbit in it's
>>> own JVM, then connecting to it and coding agains the JCR API. Does
>>> SPI provide this? Surely, I can't get this from WEBDAV or Sling, can
>>> I?
>>
>> There are two Webdav implementations in Jackrabbit: one is the simple
>> webdav server which presents the repository like a file system, with
>> built-in support for nt:folder and nt:file and customizable handlers
>> for other nodetypes.
>
> Is the use case for this a webdav client browser? Can you provide a
> reference to this simple webdav server by it's Jackrabbit component
> name, or maven module?
The simple webdav server - should probably better named file-based
webdav - is mainly used to mount the repository as a filesystem in
your operating system. Works well on Linux and MacOSX, but also under
Windows, although some people seem to prefer special webdav clients
for that environment as the default client does not provide a full
mount.
>> The other Webdav is the JCR webdav server, which provides the full JCR
>> API capabilities if used by a jcr2spi + spi2dav client setup. SPI =
>
> How is this webdav server supposed to differ from the one mentioned
> above? Is it meant to be used to remote the repository via JCR (
> though the spi packages you mention above ), or is this just an add
> on?
It provides all JCR operations. This is - afaiu - what you are looking
for. They are completely separated, this one has its endpoint at
/server, whereas the file-based simple webdav server is at
/repository/<workspace> (in the jackrabbit-webapp).
>> service provider interface (yes, a quite generic name) is a simpler
>> version of the JCR API with the possibility of batch operations,
>> useful for improving performance over remoting. There is a generic
>
> In what way is this a simpler version of the API? Specifically, my
> application will need to make use of read, write of nodes, workspace
> operations, and version control. Are these things supported?
It's a proprietary shortened API, but supporting all JCR operations.
But you don't have to code against it, I just wanted to explain the
underpinnings of this setup.
>> jcr2spi client that maps the JCR API onto the spi API. The spi2dav is
>> an spi API implementation that connects to the JCR webdav server,
>> which itself sits on top of the actual Jackrabbit repository (using
>> the JCR API itself).
>
> So, I would use the jcr2spi in my application, the client code if you
> will. And then I would use spi2dav on the webdav server?
Yes.
> I had read that SPI was supposed to supplant the poorly performing
> JCR-RMI remoting.
More or less... as noted, SPI is better for building a remote protocol
because it allows batch operations. There is an spi-rmi for example,
that should (I haven't used it myself) in theory be already better
than jcr-rmi. This would be because of the reduced property read etc.
operations. But with RMI in general the protocol is very noisy as
every method call maps to a network roundtrip.
Hence the spi2dav(ex) was built on top using HTTP/Webdav and JSON
rendering for a more efficient and readable protocol.
> Is SPI only available as a layer over webdav?
No, see the link I sent earlier:
http://jackrabbit.apache.org/jackrabbit-spi.html There is a spi2jcr
for example, which maps the spi api back to jcr.
> Thanks Alex. BTW, it seems like I'm going against the tide by trying
> to deploy my JCR as a data tier / remote resource to my application.
> Is this true?
With unstructured storages and CMS use-cases (which are typical for
JCR) replication of content is much more normal than it is with the
traditional one-big-sql-database-for-everything approach. So often you
find a webapp with a local JCR repository and that's it. To provide
fail-over, Jackrabbit allows for clustering.
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by ChadDavis <ch...@gmail.com>.
On Sun, Nov 22, 2009 at 9:22 AM, Alexander Klimetschek <ak...@day.com> wrote:
> On Fri, Nov 20, 2009 at 22:36, ChadDavis <ch...@gmail.com> wrote:
>> I'm having a hard time sorting out deployment information from the web
>> site. In perusing the mailing list, I find people recommending WEBDAV
>> or Sling as alternatives to JCR-RMI for remote communication with the
>> repository.
>>
>> I'm confused by this. Basically, I want a reference to the Repository
>> object so I can code against the JCR API. How, then, are these HTTP,
>> and other higher level protocols, seen as alternatives?
>
> Depending on your use case, an HTTP-level interface such as the Sling
> POST and GET servlets provide can be sufficient to work with the
> repository from eg. browser-based clients.
>
Depending upon my use case . . . but this is clearly not a use case
for accessing the JCR API in my application's code, correct?
>> I want to know what my options are for deploying jackrabbit in it's
>> own JVM, then connecting to it and coding agains the JCR API. Does
>> SPI provide this? Surely, I can't get this from WEBDAV or Sling, can
>> I?
>
> There are two Webdav implementations in Jackrabbit: one is the simple
> webdav server which presents the repository like a file system, with
> built-in support for nt:folder and nt:file and customizable handlers
> for other nodetypes.
Is the use case for this a webdav client browser? Can you provide a
reference to this simple webdav server by it's Jackrabbit component
name, or maven module?
>
> The other Webdav is the JCR webdav server, which provides the full JCR
> API capabilities if used by a jcr2spi + spi2dav client setup. SPI =
How is this webdav server supposed to differ from the one mentioned
above? Is it meant to be used to remote the repository via JCR (
though the spi packages you mention above ), or is this just an add
on?
> service provider interface (yes, a quite generic name) is a simpler
> version of the JCR API with the possibility of batch operations,
> useful for improving performance over remoting. There is a generic
In what way is this a simpler version of the API? Specifically, my
application will need to make use of read, write of nodes, workspace
operations, and version control. Are these things supported?
> jcr2spi client that maps the JCR API onto the spi API. The spi2dav is
> an spi API implementation that connects to the JCR webdav server,
> which itself sits on top of the actual Jackrabbit repository (using
> the JCR API itself).
So, I would use the jcr2spi in my application, the client code if you
will. And then I would use spi2dav on the webdav server?
I had read that SPI was supposed to supplant the poorly performing
JCR-RMI remoting. Is SPI only available as a layer over webdav?
>
> Regards,
> Alex
Thanks Alex. BTW, it seems like I'm going against the tide by trying
to deploy my JCR as a data tier / remote resource to my application.
Is this true? Perhaps I'm just unlucky enough to be treading the less
traveled path?
Re: JCR-RMI, SPI, WEBDAV, and Sling's REST
Posted by Alexander Klimetschek <ak...@day.com>.
On Fri, Nov 20, 2009 at 22:36, ChadDavis <ch...@gmail.com> wrote:
> I'm having a hard time sorting out deployment information from the web
> site. In perusing the mailing list, I find people recommending WEBDAV
> or Sling as alternatives to JCR-RMI for remote communication with the
> repository.
>
> I'm confused by this. Basically, I want a reference to the Repository
> object so I can code against the JCR API. How, then, are these HTTP,
> and other higher level protocols, seen as alternatives?
Depending on your use case, an HTTP-level interface such as the Sling
POST and GET servlets provide can be sufficient to work with the
repository from eg. browser-based clients.
> I want to know what my options are for deploying jackrabbit in it's
> own JVM, then connecting to it and coding agains the JCR API. Does
> SPI provide this? Surely, I can't get this from WEBDAV or Sling, can
> I?
There are two Webdav implementations in Jackrabbit: one is the simple
webdav server which presents the repository like a file system, with
built-in support for nt:folder and nt:file and customizable handlers
for other nodetypes.
The other Webdav is the JCR webdav server, which provides the full JCR
API capabilities if used by a jcr2spi + spi2dav client setup. SPI =
service provider interface (yes, a quite generic name) is a simpler
version of the JCR API with the possibility of batch operations,
useful for improving performance over remoting. There is a generic
jcr2spi client that maps the JCR API onto the spi API. The spi2dav is
an spi API implementation that connects to the JCR webdav server,
which itself sits on top of the actual Jackrabbit repository (using
the JCR API itself).
See also http://jackrabbit.apache.org/jackrabbit-spi.html
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com