Skip to content

Commit

Permalink
Merge pull request spring-projects#30 from arey/monitoring
Browse files Browse the repository at this point in the history
Restore JMX monitoring
  • Loading branch information
mszarlinski committed Dec 29, 2016
2 parents 8763efb + 6dc4b29 commit 422bad1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
12 changes: 0 additions & 12 deletions spring-petclinic-config-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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;
Expand Down Expand Up @@ -53,6 +54,7 @@ class OwnerResource {
*/
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
@Monitored
public void createOwner(@Valid @RequestBody Owner owner) {
ownerRepository.save(owner);
}
Expand All @@ -77,6 +79,7 @@ public List<Owner> findAll() {
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
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;
Expand Down Expand Up @@ -55,6 +56,7 @@ public List<PetType> getPetTypes() {

@PostMapping("/owners/{ownerId}/pets")
@ResponseStatus(HttpStatus.NO_CONTENT)
@Monitored
public void processCreationForm(
@RequestBody PetRequest petRequest,
@PathVariable("ownerId") int ownerId) {
Expand All @@ -68,6 +70,7 @@ public void processCreationForm(

@PutMapping("/owners/*/pets/{petId}")
@ResponseStatus(HttpStatus.NO_CONTENT)
@Monitored
public void processUpdateForm(@RequestBody PetRequest petRequest) {
save(petRepository.findOne(petRequest.getId()), petRequest);
}
Expand Down
25 changes: 12 additions & 13 deletions spring-petclinic-monitoring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 422bad1

Please sign in to comment.