diff --git a/spring-petclinic-config-server/pom.xml b/spring-petclinic-config-server/pom.xml index 2c937470009168c3aa47d078cd5ad33aef0bc2cf..408166c1e996cc8de9d14c779241d98cbb12d64d 100644 --- a/spring-petclinic-config-server/pom.xml +++ b/spring-petclinic-config-server/pom.xml @@ -31,18 +31,6 @@ </dependencies> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-dependencies</artifactId> - <version>Camden.SR1</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> - <build> <plugins> <plugin> diff --git a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java index 1da650a4a90692a5dcb1b47cf6650ba259ceb455..6fc57fb8e8b316d51aa35321a2157968aaa8b37a 100644 --- a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java +++ b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.samples.petclinic.customers.model.Owner; import org.springframework.samples.petclinic.customers.model.OwnerRepository; +import org.springframework.samples.petclinic.monitoring.Monitored; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -53,6 +54,7 @@ class OwnerResource { */ @PostMapping @ResponseStatus(HttpStatus.CREATED) + @Monitored public void createOwner(@Valid @RequestBody Owner owner) { ownerRepository.save(owner); } @@ -77,6 +79,7 @@ class OwnerResource { * Update Owner */ @PutMapping(value = "/{ownerId}") + @Monitored public Owner updateOwner(@PathVariable("ownerId") int ownerId, @Valid @RequestBody Owner ownerRequest) { final Owner ownerModel = ownerRepository.findOne(ownerId); // This is done by hand for simplicity purpose. In a real life use-case we should consider using MapStruct. diff --git a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java index aa007cbeb974a4ff41122cfb86cb3f01b8949ead..4e213ec47a0fb07116b4b8da58f0906b79dc889e 100644 --- a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java +++ b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java @@ -26,6 +26,7 @@ import org.springframework.samples.petclinic.customers.model.OwnerRepository; import org.springframework.samples.petclinic.customers.model.Pet; import org.springframework.samples.petclinic.customers.model.PetRepository; import org.springframework.samples.petclinic.customers.model.PetType; +import org.springframework.samples.petclinic.monitoring.Monitored; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -55,6 +56,7 @@ class PetResource { @PostMapping("/owners/{ownerId}/pets") @ResponseStatus(HttpStatus.NO_CONTENT) + @Monitored public void processCreationForm( @RequestBody PetRequest petRequest, @PathVariable("ownerId") int ownerId) { @@ -68,6 +70,7 @@ class PetResource { @PutMapping("/owners/*/pets/{petId}") @ResponseStatus(HttpStatus.NO_CONTENT) + @Monitored public void processUpdateForm(@RequestBody PetRequest petRequest) { save(petRepository.findOne(petRequest.getId()), petRequest); } diff --git a/spring-petclinic-monitoring/pom.xml b/spring-petclinic-monitoring/pom.xml index 76bfe62deee11f57f1787d87f2db17e678a88d78..d4e3f65fd0280d89957eabaef11ad98959dfa4de 100644 --- a/spring-petclinic-monitoring/pom.xml +++ b/spring-petclinic-monitoring/pom.xml @@ -10,24 +10,23 @@ <packaging>jar</packaging> <description>Spring PetClinic monitoring utilities</description> + <parent> + <groupId>org.springframework.samples</groupId> + <artifactId>spring-petclinic-microservices</artifactId> + <version>1.4.2</version> + </parent> + <dependencies> - <!-- Third-parties --> - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>aspectjweaver</artifactId> - <version>1.8.0</version> - </dependency> + <!-- Spring dependencies --> <dependency> <groupId>org.springframework</groupId> - <artifactId>spring-jmx</artifactId> - <scope>provided</scope> - <version>2.0.8</version> + <artifactId>spring-context</artifactId> </dependency> + + <!-- Third-parties --> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <scope>provided</scope> - <version>4.3.4.RELEASE</version> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> </dependency> </dependencies> </project>