-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIxes #64 - wires Rest, Http, Metric modules through MacWire. Cake Pa…
…ttern version with traits.
- Loading branch information
Alexander Weber
committed
Apr 25, 2016
1 parent
5798ab6
commit dd02108
Showing
6 changed files
with
24 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
chaos-examples/src/main/scala/mesosphere/chaos/examples/persons/PersonsModule.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package mesosphere.chaos.examples.persons | ||
|
||
import mesosphere.chaos.ChaosModule | ||
import mesosphere.chaos.examples.persons.impl.PersonsResource | ||
import mesosphere.chaos.rest.RestModule | ||
import com.softwaremill.macwire._ | ||
|
||
class PersonsModule(chaosModule: ChaosModule) extends RestModule(chaosModule) { | ||
@Module | ||
trait PersonsModule extends RestModule { | ||
lazy val persons = Seq("Alice", "Bob", "Christoph", "Dimitri") | ||
lazy val personsResource = wire[PersonsResource] | ||
lazy val personsResource = new PersonsResource(persons) | ||
|
||
httpService.registerResources(personsResource) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
package mesosphere.chaos | ||
|
||
import mesosphere.chaos.http.{ HttpConf, HttpModule } | ||
import com.softwaremill.macwire.Module | ||
import mesosphere.chaos.http.HttpModule | ||
import mesosphere.chaos.metrics.MetricsModule | ||
import com.softwaremill.macwire._ | ||
|
||
/** | ||
* Wraps up the metrics and http modules. | ||
* @param conf configuration used to set up the http server. | ||
*/ | ||
@Module | ||
class ChaosModule(conf: HttpConf) { | ||
lazy val httpModule = wire[HttpModule] | ||
lazy val metricsModule = wire[MetricsModule] | ||
// Needed for http module. | ||
lazy val metricsRegistry = metricsModule.registry | ||
trait ChaosModule extends MetricsModule with HttpModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters