perwendel/spark — pull request #167 by ggalmazor (2014-07-01 13:56:40+00:00)
Title: Implemented instance API as an alternative to the static API.

This has to do with prior pull-request #77. I tried to solve the conflicts for that pull-request but finally decided to start form scratch:

- The static API remains untouched.
- Migrated logic to SparkInstace class
- Replaced logic from Spark & SparkBase to use a default instance of SparkInstance
- Written instance API versions of all tests
- Written a test to probe that we are able to run two instances at the same time on different ports

Instances of SparkInstance are obtained through a Builder class. This enables to get instances in a much safer way, as setters are now protected (no risk of IllegalStateException when using instances).

Take a look at [InstanceBooks.java](https://github.com/ggalmazor/spark/blob/70dc5fcef31b726a18534a243655bb0f9d88e447/src/test/java/spark/examples/books/InstanceBooks.java) and all the tests in src/test/java/spark/instance_api folder for usage examples of the new API.