List of usage examples for org.springframework.aop.framework Advised getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.openmrs.api.context.ServiceContext.java
/** * Moves advisors and advice added by ServiceContext from the source service to the target one. * * @param source the existing service// w ww. jav a 2 s .co m * @param target the new service */ @SuppressWarnings("unchecked") private void moveAddedAOP(Advised source, Advised target) { Class serviceClass = source.getClass(); Set<Advisor> existingAdvisors = getAddedAdvisors(serviceClass); for (Advisor advisor : existingAdvisors) { target.addAdvisor(advisor); source.removeAdvisor(advisor); } Set<Advice> existingAdvice = getAddedAdvice(serviceClass); for (Advice advice : existingAdvice) { target.addAdvice(advice); source.removeAdvice(advice); } }