Fix issue with cluster bricking if specific message lost when master leaves.

 o When a master leaves, if the leave learned message did not reach the machine with the
   lowest id, the other instances would wait for that instance to start an election
   indefinitely. The instance with the lowest id would realize it was out of date, but
   try and contact the (now dead) master to catch up, and would not retry when that failed.

 o This implementation fixes this by preferring instances more likely to be live and to have
   the paxos instance id we are interested in (see CommonContextStateTest and LearnerStateTest).
 o It also introduces proper retries if the catchup fails.
Merge pull request #2091 from jakewins/1.9-learnit

Fixes problem with re-electing master on message loss
Remove the OSGi example.

It was removed last year from 2.0 because it was flaky and it now fails
incomprehensibly on TeamCity. There doesn't seem to be any point
spending lots of time working out what is wrong with it just for this
one unimportant example.

Conflicts:
	community/embedded-examples/src/test/java/org/neo4j/examples/osgi/Neo4jActivator.java
	community/embedded-examples/src/test/java/org/neo4j/examples/osgi/OSGiDocIT.java
Introduce the StoreChannel abstraction, and the AdversarialFSA.

The StoreChannel interface is very similar to the API of the FileChannel class.
I had to introduce it because of the many final methods of the FileChannel.
The AdversarialFileSystemAbstraction needed to be able to throw exceptions from those methods
that were marked as final in the FileChannel, so I had to abstract away the FileChannel itself, and
introduce this new indirection. The StoreFileChannel wraps a FileChannel while exposing the
StoreChannel API.

The AdversarialFileSystemAbstraction is a file system that can be configured to throw exceptions and
failures as we please. This is useful for testing partial failure scenarios that our current robustness
suite does not cover, since it currently only works by killing entire processes - not individual
transactions.
Additional cleanup after the introduction of StoreChannel
Add mischief to the adversarial file system.
Merge pull request #2132 from chrisvest/1.9-adversarial-fs

Introduce the StoreChannel abstraction, and the AdversarialFSA.
Fix building 1.9 on Java 6
Merge pull request #2144 from chrisvest/1.9-fix-java6-build

Fix building 1.9 on Java 6
Also fix the test compilation on Java 6
Raise an exception if Server shutdown fails.

Rather than just log exceptions that happen during shutdown, we
carefullly catch and record them. Then after shutdown is complete, if
there was an exception during the process we re-raise it.

This change uncovered a couple of problems that were previously being
ignored. They are cases where tests call #stop() even though #start()
did not succeed. Those #stop() methods are now more defensive to cope
with that.
Merge pull request #2153 from benbc/1.9-dont-swallow-server-shutdown-exceptions

Raise an exception if Server shutdown fails.
Fix exception merging to be compatible with Java 1.6.
Don't access resources during shutdown.

The XaDataSourceManager was creating new resources in
unregisterDataSource(). When this method is called during shutdown,
other components may already have been shut down so the resource
creation may fail.

The particular case we saw was a race condition shutting down during a
master switch, which caused a NullPointerException in
XaConnectionHelperImpl when LuceneDataSource tried to create a
LuceneXaResource with a null XaResourceManager (which had been nulled
out during the master switch).
Remove a catch block that was suppressing failures in a test and make the test more robust.

The catch block in HTTPLoggingDocIT was suppressing all failures. Once
it had been removed it became apparent that the test was
flaky. Specifically it almost always failed in my IDE when run
alone (although it passed when run with the other tests in the file). I
believe the flakiness was because the log file wasn't always flushed to
disk before the assertion was reached.
Isolate HTTPLoggingDocIT from other tests that use the shared server.

o Server tests that create their own server need to extend
  ExclusiveServerTestBase in order to ensure that the shared server is
  not running while they execute.
o HTTPLoggingDocIT runs its own server because it needs specific
  configuration.
Server can dictate which logging kernel uses

And will, in the server setup, have server and kernel use the same logging mechanisms.
This commit also removes usages of java.util.logging from server in favor
of the console logger in kernel.
Merge pull request #2159 from benbc/1.9-dont-access-resources-during-shutdown

Don't access resources during shutdown.
Don't swallow output in problematic test.

TestRecovery is failing on OSX under TeamCity. We need to avoid throwing
away the output from the subprocess so that we can diagnose the problem.
Specify Java subprocess is headless. Needed on OSX with Java 1.6 only.