Examples of Advised


Examples of org.springframework.aop.framework.Advised

        }

        private static void validateBeanCycle(Object auth, Set<String> beanNames) {
            if(auth != null && !beanNames.isEmpty()) {
                if(auth instanceof Advised){
                    Advised advised = (Advised) auth;
                    TargetSource targetSource = advised.getTargetSource();
                    if(targetSource instanceof LazyInitTargetSource) {
                        LazyInitTargetSource lits = (LazyInitTargetSource) targetSource;
                        if(beanNames.contains(lits.getTargetBeanName())) {
                            throw new FatalBeanException("A dependency cycle was detected when trying to resolve the AuthenticationManager. Please ensure you have configured authentication.");
                        }
View Full Code Here

Examples of org.springframework.aop.framework.Advised

        }

        // Determine the type that declares the requested method, taking into account proxies
        Class<?> target = AopUtils.getTargetClass(object);
        if (object instanceof Advised) {
            Advised a = (Advised) object;
            if (!a.isProxyTargetClass()) {
                Class<?>[] possibleInterfaces = a.getProxiedInterfaces();
                for (Class<?> possibleInterface : possibleInterfaces) {
                    try {
                        possibleInterface.getMethod(methodName, classArgs);
                        // to get here means no exception happened
                        target = possibleInterface;
View Full Code Here

Examples of org.springframework.aop.framework.Advised

        return cls;
    }
   
    protected Class getRealClassInternal(Object o) {
        if (AopUtils.isAopProxy(o)) {
            Advised advised = (Advised)o;
            try {
                Object target = advised.getTargetSource().getTarget();
               
                if (target == null) {
                    Class targetClass = AopUtils.getTargetClass(o);
                    if (targetClass != null) {
                        return targetClass;
View Full Code Here

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

Examples of org.springframework.aop.framework.Advised

    }

    @SuppressWarnings("deprecation")
    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

Examples of org.springframework.aop.framework.Advised

        return cls;
    }
   
    protected Class getRealClassInternal(Object o) {
        if (AopUtils.isAopProxy(o)) {
            Advised advised = (Advised)o;
            try {
                Object target = advised.getTargetSource().getTarget();
               
                if (target == null) {
                    return AopUtils.getTargetClass(o);
                } else {
                    return getRealClassInternal(target);
View Full Code Here

Examples of org.springframework.aop.framework.Advised

        after = System.currentTimeMillis();;
       
        System.out.println("Took " + (after - before) + " ms");
       
        // testing method on Advised
        Advised advised = (Advised)bean;
       
        System.out.println("Testing Advised.getProxyTargetClass() Method");
        before = System.currentTimeMillis();
        for(int x = 0; x < 500000; x++) {
            advised.getProxyTargetClass();
        }
        after = System.currentTimeMillis();;
       
        System.out.println("Took " + (after - before) + " ms");
       
View Full Code Here

Examples of org.springframework.aop.framework.Advised

    proxy.getAge();
    assertEquals(1, ptm.commits);

    ITestBean serializedProxy = (ITestBean) SerializationTestUtils.serializeAndDeserialize(proxy);
    serializedProxy.getAge();
    Advised advised = (Advised) serializedProxy;
    TransactionInterceptor serializedTi = (TransactionInterceptor) advised.getAdvisors()[0].getAdvice();
    CallCountingTransactionManager serializedPtm =
        (CallCountingTransactionManager) serializedTi.getTransactionManager();
    assertEquals(2, serializedPtm.commits);
  }
View Full Code Here

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

Examples of org.springframework.aop.framework.Advised

        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
TOP
Copyright © 2018 www.massapi.com. 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.