You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2009/10/19 16:33:08 UTC

[Jackrabbit Wiki] Update of "ExamplesPage" by ThomasMueller

Dear Wiki user,

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

The "ExamplesPage" page has been changed by ThomasMueller.
http://wiki.apache.org/jackrabbit/ExamplesPage?action=diff&rev1=29&rev2=30

--------------------------------------------------

  === Jackrabbit Cache Configuration ===
  This info has moved to the CacheManager page.
  
+ === Is the Repository Running? ==
+ 
+ {{{
+ /**
+  * Check if a repository is currently running. This only works when
+  * using the CooperativeFileLock, see
+  * http://wiki.apache.org/jackrabbit/RepositoryLock
+  */
+ static boolean isRepositoryRunning(String repositoryHome) {
+     File lock = new File(repositoryHome + "/lock.properties");
+     if (lock.exists()) {
+         lock.delete();
+     }
+     try {
+         Thread.sleep(2000);
+     } catch (Exception e) {
+         throw new RuntimeException(e);
+     }
+     return lock.exists();
+ }
+ }}}
+ 
  == See also ==
  
   * [[EncodingAndEscaping]]