Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 65904 invoked from network); 20 Jan 2010 17:02:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jan 2010 17:02:20 -0000 Received: (qmail 40871 invoked by uid 500); 20 Jan 2010 17:02:20 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 40791 invoked by uid 500); 20 Jan 2010 17:02:20 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 40782 invoked by uid 99); 20 Jan 2010 17:02:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jan 2010 17:02:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jan 2010 17:02:17 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id E736A16E0A for ; Wed, 20 Jan 2010 17:01:56 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Wed, 20 Jan 2010 17:01:56 -0000 Message-ID: <20100120170156.7684.71364@eos.apache.org> Subject: =?utf-8?q?=5BJackrabbit_Wiki=5D_Update_of_=22RemoteAccess=22_by_JukkaZitt?= =?utf-8?q?ing?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" fo= r change notification. The "RemoteAccess" page has been changed by JukkaZitting. The comment on this change is: Update RMI connection instructions. http://wiki.apache.org/jackrabbit/RemoteAccess?action=3Ddiff&rev1=3D5&rev2= =3D6 -------------------------------------------------- = Jackrabbit 2.0 supports the !DavEx protocol through the Jackrabbit WebDAV= server included in the Jackrabbit web application and the [[http://jackrab= bit.apache.org/standalone-server.html|Standalone Server]]. The web applicat= ion exposes the !DavEx interface at http:////server and th= e standalone server by default at http://localhost:8080/server. = - On the client side, you need the following Maven dependencies (note that = jackrabbit-jcr2dav is not yet available in an official Jackrabbit release, = but it will be included in Jackrabbit 2.0.0): + On the client side, you need the following Maven dependencies: = {{{ @@ -27, +27 @@ org.apache.jackrabbit jackrabbit-jcr2dav - 2.0-SNAPSHOT + 2.0-beta6 @@ -54, +54 @@ = The JCR API can be accessed over RMI. Limitations: Jackrabbit over RMI is= slow. The JCR 2.0 API is only partially supported in Jackrabbit 2.0 (most = of the new JCR 2.0 methods simply throw UnsupportedRepositoryOperationExcep= tions). = - To start a standalone RMI server, use: + The easiest way to access a Jackrabbit repository over RMI is to use the = RMI endpoint that the Jackrabbit standalone jar exposes at http://localhost= :8080/rmi. You need the following code snippet and the jackrabbit-jcr-rmi a= nd jackrabbit-jcr-commons dependencies to connect to this endpoint: = {{{ - Repository repository =3D new TransientRepository(); + import javax.jcr.Repository; + import org.apache.jackrabbit.commons.JcrUtils; + = + Repository repository =3D JcrUtils.getRepository("http://localhost:8080/r= mi"); + }}} + = + If you use Jackrabbit in embedded mode, you can expose your repository to= remote clients by starting the RMI registry (if one is not already running= ) and binding the remote reference there: + = + {{{ + // Start the RMI registry + Registry reg =3D LocateRegistry.createRegistry(1100); + = + // Bind the repository reference to the registry + Repository repository =3D ...; ServerAdapterFactory factory =3D new ServerAdapterFactory(); RemoteRepository remote =3D factory.getRemoteRepository(repository); - Registry reg =3D LocateRegistry.createRegistry(1100); reg.rebind("jackrabbit", remote); }}} = + Note that you need to keep an explicit local reference to the RemoteRepos= itory object above to prevent the garbage collector from claiming it. + = - To connect to the server, use: + To connect to such a server, use: = {{{ - ClientRepositoryFactory factory =3D new ClientRepositoryFactory(); + import javax.jcr.Repository; + import org.apache.jackrabbit.commons.JcrUtils; + = - Repository repository =3D factory.getRepository("rmi://localhost:1100/jac= krabbit"); + Repository repository =3D JcrUtils.getRepository("rmi://localhost:1100/ja= ckrabbit"); }}} =20