ModeShape/modeshape — pull request #769 by hchiorean (2013-04-03 17:03:04+00:00)
Title: Mode 1872 - Started work on making the re-indexing process asynchronous by default

### This is not ready to be merged because of (2) (see below)

The configuration changes needed to make re-indexing async were easy enough. However, they exposed 2 problems:

(1) re-indexing needs to be shutdown when a repository is shut down: it may happen (and it does in our tests) that a repository/engine is shutdown while re-indexing is still in progress. This meant that additional code was needed to make sure re-indexing is shut down as well.

(2) after the above changes, random tests from modeshape-jcr start failing with basically this exception (in various forms):
```
javax.jcr.PathNotFoundException: The child "jcr:system" could not be found under "/" in workspace "default"
at org.modeshape.jcr.AbstractJcrNode.getNode(AbstractJcrNode.java:798)
at org.modeshape.jcr.AbstractJcrNode.getNode(AbstractJcrNode.java:107)
at org.modeshape.jcr.RepositoryNodeTypeManagerTest.shouldOnlyHaveOneNodeTypesNode(RepositoryNodeTypeManagerTest.java:91)
```

At least a couple of things are interesting about the above:
a) the exceptions occur as "top-level" exceptions in tests, unrelated to indexing, as-if nodes are being "magically" altered in the repository
b) the re-indexing processing is entirely *read-only*, meaning that it does not alter any node state, only adds/updates index segments.