jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: Ways of connecting a remote client to a repository
Date Thu, 13 Aug 2009 08:55:24 GMT
hi sebastian

On Mon, Aug 10, 2009 at 10:53 AM, Sebastian
Lindstaedt<Sebastian.Lindstaedt@vaberlin.de> wrote:
> Hi,
>
> Before asking my Question(s) let me describe my Application shortly.
>
> I use a JBoss 4.3.x Applicationserver with Swing RMI-(Fat)Clients.
> In the JBoss I deployed jackrabbit-jca and jackrabbit-jcr-rmi, so the (Swing)Clients
talk to the Repository via RMI.
> This is Deploymentmodel 2, isnt it?

no, that would be deployment model 3 (client/server deployment model).

>
> I have read from different postings that rmi can be slow (I could improve it by using
clustering, but this is no option for me, unfortunately), so I want to change that before
going into production. What are my options?
> What I have learned so far by digging through the mailinglists/jackrabbit-homepage there
are two options for connecting to a remote repository. This post (http://thread.gmane.org/gmane.comp.apache.jackrabbit.user/11651/focus=11662
<http://thread.gmane.org/gmane.comp.apache.jackrabbit.user/11651/focus=11662> ) suggests,
we can use rmi or webdav. If I would like to walk the "webdav-way" what would it take? On
the serverside, the JBoss Server exposes the Jackrabbit Repository (from the jackrabbit-jca
components) via the WebDAV-Server Servlet (from the jackrabbit-webapp) to remoting clients,
is that correct?

i am not familiar with jboss, but i guess yes.

>
> What is needed at the (remote) client side? The webpage, that introduces Jackrabbit SPI
(http://jackrabbit.apache.org/jackrabbit-spi.html <http://jackrabbit.apache.org/jackrabbit-spi.html>
) shows the following "chain": jcr2spi <--> spi2dav <--> jcr-server. As far as
I understand I need jcr2spi and spi2dav at the remote client and the jcr-server (which is
a repository + webdav servlet) at the JBoss Server.

correct

> Is this chain recommended for a production system?

we're using it for a quite while now internally without any problems
so far. it's pretty stable and quite fast (in fact a *lot* faster than
rmi ;). give it a try and decide for yourself whether it's good enough
for your production system.

here's a client-side (incomplete) code fragment to get you started:

    public Repository getRepository() throws RepositoryException {
        BatchReadConfig batchReadConfig = new BatchReadConfig() {
            public int getDepth(Path path, PathResolver resolver)
                    throws NamespaceException {
                return batchReadDepth;
            }
        };
        final RepositoryServiceImpl srvc = new
RepositoryServiceImpl(uri, defaultWorkspaceName, batchReadConfig);

        RepositoryConfig repConfig = new RepositoryConfig() {
            public CacheBehaviour getCacheBehaviour() {
                return cacheBehaviour;
            }

            public int getItemCacheSize() {
                return itemCacheSize;
            }

            public int getPollTimeout() {
                return pollTimeout;
            }

            public RepositoryService getRepositoryService()
                    throws RepositoryException {
                return srvc;
            }
        };
        return RepositoryImpl.create(repConfig);
    }


cheers
stefan

>
>
> regards,
>
> Sebastian
>

Mime
View raw message