Package org.springframework.aop.framework

Examples of org.springframework.aop.framework.Advised


     * There is currently no way of testing whether this will happen, ie null will never
     * be returned from this method.
     */
    public static Object getRealBean(Object proxy) throws Exception
    {
        Advised advised = (Advised) proxy;
        TargetSource targetSource = advised.getTargetSource();
        Object real = targetSource.getTarget();
       
        // Possibly we could add a method on the ScopedBeanTargetSource class to test
        // whether the target bean exists. Then here we could cast TargetSource to
        // ScopedBeanTargetSource and return null if the target does not exist. This
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    public static <T> T unpackProxy(T proxy) throws Exception {
        if (proxy instanceof Advised) {
            Advised advised = (Advised) proxy;
            return (T) advised.getTargetSource().getTarget();
        }

        return proxy;
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public static <T> T unpackProxy(T proxy) {
        if (proxy instanceof Advised) {
            Advised advised = (Advised) proxy;
            try {
                return (T) advised.getTargetSource().getTarget();
            } catch (Exception e) {
                throw new ProxyUnpackException(e);
            }
        }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private static <T> T unpackProxy(T proxy) throws Exception {
        if (proxy instanceof Advised) {
            Advised advised = (Advised) proxy;
            return (T) advised.getTargetSource().getTarget();
        }

        return proxy;
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public static <T> T unpackProxy(T proxy) throws Exception {
        if (proxy instanceof Advised) {
            Advised advised = (Advised) proxy;
            return (T) advised.getTargetSource().getTarget();
        }

        return proxy;
    }
View Full Code Here

    }
    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

    }
  }
 
  private void clear(ApprovalStore approvalStore) throws Exception {
    if (approvalStore instanceof Advised) {
      Advised advised = (Advised) tokenStore;
      ApprovalStore target = (ApprovalStore) advised.getTargetSource().getTarget();
      clear(target);
      return;
    }
    if (approvalStore instanceof InMemoryApprovalStore) {
      ((InMemoryApprovalStore) approvalStore).clear();
View Full Code Here

    }
  }

  private void clear(TokenStore tokenStore) throws Exception {
    if (tokenStore instanceof Advised) {
      Advised advised = (Advised) tokenStore;
      TokenStore target = (TokenStore) advised.getTargetSource().getTarget();
      clear(target);
      return;
    }
    if (tokenStore instanceof InMemoryTokenStore) {
      ((InMemoryTokenStore) tokenStore).clear();
View Full Code Here

            .getBytes()));
  }

  private void clear(ApprovalStore approvalStore) throws Exception {
    if (approvalStore instanceof Advised) {
      Advised advised = (Advised) tokenStore;
      ApprovalStore target = (ApprovalStore) advised.getTargetSource().getTarget();
      clear(target);
      return;
    }
    if (approvalStore instanceof InMemoryApprovalStore) {
      ((InMemoryApprovalStore) approvalStore).clear();
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.