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 "HowtoSpi2Rmi" by ScottCytacki
Date Thu, 03 Jul 2008 14:16:59 GMT
Dear Wiki user,

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

The following page has been changed by ScottCytacki:
http://wiki.apache.org/jackrabbit/HowtoSpi2Rmi

------------------------------------------------------------------------------
  
  This project has a class org.apache.jackrabbit.jcr2spi.SPIServer which starts up the SPI
RMI Server
  
+ == Setup a spi rmi client ==
+ 
+ This code was duplicated from org.apache.jackrabbit.jcr2spi.JCR2SPIOverRMIRepositoryStub
which is located
+ in https://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/client (jackrabbit-test-client)
+ That code uses a AbstractRepositoryConfig instead which is defined in jackrabbit-test-client.
 This code
+ fully implements RepositoryConfig so it doesn't need to depend on jackrabbit-test-client.
+ 
+ 
+ {{{
+ Registry registry = LocateRegistry.getRegistry("localhost", Registry.REGISTRY_PORT);
+ RemoteRepositoryService remoteRepoService =
+   (RemoteRepositoryService) registry.lookup("jackrabbit.spi-server");
+ 			
+ final RepositoryService localRepoService = new ClientRepositoryService(remoteRepoService);
+ 
+ Repository repo = RepositoryImpl.create(new RepositoryConfig(){
+   public RepositoryService getRepositoryService() {
+     return localRepoService;
+   }
+ 
+   public String getDefaultWorkspaceName() {
+     return null;
+   }
+ 
+   public CacheBehaviour getCacheBehaviour() {
+     return CacheBehaviour.INVALIDATE;
+   }
+             	
+ });
+ 
+ }}}
+ 

Mime
View raw message