diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java new file mode 100644 index 000000000..191253587 --- /dev/null +++ b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java @@ -0,0 +1,35 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.samples.petclinic; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * PetClinic Spring Boot Application. + * + * @author Dave Syer + * + */ +@SpringBootApplication(proxyBeanMethods = false) +public class PetClinicApplication { + + public static void main(String[] args) { + SpringApplication.run(PetClinicApplication.class, args); + } + +} diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicAspect.java b/src/main/java/org/springframework/samples/petclinic/PetClinicAspect.java deleted file mode 100644 index d61d28471..000000000 --- a/src/main/java/org/springframework/samples/petclinic/PetClinicAspect.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.springframework.samples.petclinic; - -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import brave.Span; -import brave.Span.Kind; -import brave.Tracer; - -@Aspect -@Component -public class PetClinicAspect { - - @Value("${petclinic.db.type:local}") - String dbType; - - @Value("${petclinic.db.instance:localDB}") - String dbInstance; - - @Autowired - Tracer tracer; - - // @Around("execution(* org.springframework.data.repository.Repository+.*(..)))") - @Around("execution(* org.springframework.samples.petclinic.*.*Repository+.*(..)))") - public Object AddSpan(ProceedingJoinPoint joinpoint) throws Throwable { - Span newSpan = this.tracer.nextSpan().name(joinpoint.getSignature().toString()).start(); - - try { - newSpan.tag("component", "java-jdbc"); - newSpan.kind(Kind.CLIENT); - newSpan.tag("db.type", dbType); - newSpan.tag("db.instance", dbInstance); - Object result = joinpoint.proceed(); - - return result; - } - finally { - newSpan.finish(); - } - - } - -} \ No newline at end of file