Examples of addAdvisor()


Examples of org.springframework.aop.framework.ProxyFactory.addAdvisor()

   */
  protected void setUp() {
    ProxyFactory pf = new ProxyFactory(new SerializablePerson());
    nop = new SerializableNopInterceptor();
    pc = new NameMatchMethodPointcut();
    pf.addAdvisor(new DefaultPointcutAdvisor(pc, nop));
    proxied = (Person) pf.getProxy();
  }
 
  public void testMatchingOnly() {
    // Can't do exact matching through isMatch
View Full Code Here

Examples of org.springframework.aop.framework.ProxyFactory.addAdvisor()

   
    HotSwappableTargetSource hts = new HotSwappableTargetSource(sp1);
    ProxyFactory pf = new ProxyFactory();
    pf.addInterface(Person.class);
    pf.setTargetSource(hts);
    pf.addAdvisor(new DefaultPointcutAdvisor(new SerializableNopInterceptor()));
    Person p = (Person) pf.getProxy();
   
    assertEquals(sp1.getName(), p.getName());
    hts.swap(sp2);
    assertEquals(sp2.getName(), p.getName());
View Full Code Here

Examples of org.springframework.aop.framework.ProxyFactory.addAdvisor()

    ts.getTimeStamp();
    long timestamp = 111L;
    tsControl.setReturnValue(timestamp, 1);
    tsControl.replay();

    factory.addAdvisor(0, new DefaultIntroductionAdvisor(new DelegatingIntroductionInterceptor(ts)));
   
    TimeStamped tsp = (TimeStamped) factory.getProxy();
    assertTrue(tsp.getTimeStamp() == timestamp);
 
    tsControl.verify();
View Full Code Here

Examples of org.springframework.aop.framework.ProxyFactory.addAdvisor()

    ts.getTimeStamp();
    long timestamp = 111L;
    tsControl.setReturnValue(timestamp, 1);
    tsControl.replay();

    factory.addAdvisor(0, new DefaultIntroductionAdvisor(new DelegatingIntroductionInterceptor(ts), SubTimeStamped.class));

    SubTimeStamped tsp = (SubTimeStamped) factory.getProxy();
    assertTrue(tsp.getTimeStamp() == timestamp);

    tsControl.verify();
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.