jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jackrabbit Wiki] Update of "RemoteAccess" by ThomasMueller
Date Mon, 04 Jan 2010 13:35:57 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The "RemoteAccess" page has been changed by ThomasMueller.


New page:
== Remote Access ==


== Overview ==

Jackrabbit supports remote access using Dav``Ex (since Jackrabbit 2.0) and using RMI.

== DavEx ==

For Jackrabbit 2 and assuming the server is running at localhost port 8080:

HashMap<String, String> params = new HashMap<String, String>();
Repository repository = JcrUtils.getRepository(params);

For this to work the Spi2davex``Repository``Service``Factory needs to be on the classpath
(see jackrabbit-spi2dav).

See also org.apache.jackrabbit.commons.Jcr``Utils#get``Repository(String), org.apache.jackrabbit.commons.Jcr``Utils#get``Repository(java.util.Map)
for applicable configuration parameters.

== RMI ==

Jackrabbit over RMI is slow. 

To start a standalone RMI server, use:

Repository repository = new TransientRepository();
ServerAdapterFactory factory = new ServerAdapterFactory();
RemoteRepository remote = factory.getRemoteRepository(repository);
Registry reg = LocateRegistry.createRegistry(1100);
reg.rebind("jackrabbit", remote);

To connect to the server, use:

ClientRepositoryFactory factory = new ClientRepositoryFactory();
Repository repository = factory.getRepository("rmi://localhost:1100/jackrabbit");

View raw message