Microsoft-CISL/REEF — pull request #754 by markusweimer (2014-04-14 17:48:35+00:00)
Title: Logging and Injection improvements

This branch contains work towards #486 that is helpful, although it doesn't quite close that issue yet:

**Logging improvements**
* More REEF classes on the DriverSide now log their instantiation. This is helpful when debugging issues of multiple instantiations.
* We now have our very own logging formatter that is enabled in the `-Plog` profile. It prints the sequence number instead of a timestamp and also produces more dense log output.

**Injection Improvements**
With [Tang #486](https://github.com/Microsoft-CISL/TANG/pull/168) on the horizon, it becomes more important to explicitly control which objects get instantiated when, mostly to make sure that forked injectors all share the same instance. To that end, this adds two new features:

* `com.microsoft.reef.runtime.common.launch.LauncherSingletons`. Bind things to this named parameter to mark them as singletons for this Launcher process. The objects here will be instantiated before the `Clock` and by the same `Injector` used for the `Clock`. This is mostly useful for REEF itself.
* `com.microsoft.reef.runtime.common.driver.parameters.DriverSingletons` provides a similar named parameter to dedicate objects to be instantiated only once in the Driver.

**Reduced exposure of `Clock`**
Direct calls to methods of `Clock`, especially `Clock.close()` are dangerous. Also, limiting bindings to `RuntimeStart` and `RuntimeStop` helps with debugging things. To that end, this PR adds a new interface for resource managers to bind to: `com.microsoft.reef.runtime.common.driver.api.ResourceManagerLifeCycle`. The methods `onStart` and `onStop` in this interface are called by REEF's handlers for `RuntimeStart` and `RuntimeStop`, reducing the need for the RM to bind to those events.