Package org.springframework.aop.framework

Examples of org.springframework.aop.framework.Advised


    }
    protected Object getRealObjectInternal(Object o) {
        if (o instanceof Advised) {
            try {

                Advised advised = (Advised)o;
                Object target = advised.getTargetSource().getTarget();
                //could be a proxy of a proxy.....  
                return getRealObjectInternal(target);
            } catch (Exception ex) {
                // ignore
            }
View Full Code Here


        return o;
    }

    protected Class<?> getRealClassInternal(Object o) {
        if (AopUtils.isAopProxy(o) && (o instanceof Advised)) {
            Advised advised = (Advised)o;
            try {
                TargetSource targetSource = advised.getTargetSource();
               
                Object target = null;
               
                try {
                    target = targetSource.getTarget();
View Full Code Here

  @Override
  public Object postProcessAfterInitialization(Object bean, String beanName)
      throws BeansException {
    if (bean instanceof Advised) {
      Advised advised = (Advised) bean;

      for (Advisor advisor : advised.getAdvisors()) {
        if (advisor instanceof AspectJPointcutAdvisor) {
          String foundName = ((AbstractAspectJAdvice) ((AspectJPointcutAdvisor) advisor)
              .getAdvice()).getAspectName();
          if (aspect.getName().equals(foundName)) {
            LOG.info("Found bean advised by " + aspect + "; injecting");
            try {
              aspect.addAdvised(advised.getTargetSource().getTarget(), beanName);
            } catch (Exception e) {
              throw new RuntimeException(e);
            }
          }
        }
View Full Code Here

TOP

Related Classes of org.springframework.aop.framework.Advised

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.