Example usage for org.springframework.aop.framework Advised getClass

List of usage examples for org.springframework.aop.framework Advised getClass

Introduction

In this page you can find the example usage for org.springframework.aop.framework Advised getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

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);
    }
}