Examples of AOPProxyFactoryMixin


Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

      SimpleInterceptor.invoked = null;
      ReturningInterceptor.invoked = null;
      AnotherMixin.invoked = false;

      AOPProxyFactoryMixin[] mixins = {
            new AOPProxyFactoryMixin(SimpleMixin.class, new Class[]{Simple.class}),
            new AOPProxyFactoryMixin(AnotherMixin.class, new Class[] {Another.class})};
      Object proxy = assertCreateHollowProxy(
            new Class[] {Other.class, Tagging.class},
            mixins,
            null,
            new Class[] {Other.class, Simple.class, Tagging.class, Another.class});
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

   {
      SimpleMixin.invoked = false;
      SimpleInterceptor.invoked = null;

      PlainBean bean = new PlainBean();
      AOPProxyFactoryMixin[] mixins = {new AOPProxyFactoryMixin(SimpleMixin.class, new Class[]{Simple.class})};
      Object proxy = assertCreateProxy(bean, mixins, Simple.class);

      Simple simple = (Simple)proxy;
      simple.doSomething();
      assertTrue(SimpleMixin.invoked);
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

      SimpleMixinWithConstructorAndDelegate.invoked = false;
      SimpleMixinWithConstructorAndDelegate.proxy = null;
      SimpleMixinWithConstructorAndDelegate.delegate = null;

      PlainBean bean = new PlainBean();
      AOPProxyFactoryMixin[] mixins = {new AOPProxyFactoryMixin(SimpleMixinWithConstructorAndDelegate.class, new Class[]{Simple.class}, "this")};
      Object proxy = assertCreateProxy(bean, mixins, Simple.class);

      Simple simple = (Simple)proxy;
      simple.doSomething();
      assertTrue(SimpleMixinWithConstructorAndDelegate.invoked);
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

   public void testSimpleMixinDefaultConstructor() throws Exception
   {
      SimpleMixin.invoked = false;
      SimpleInterceptor.invoked = null;

      AOPProxyFactoryMixin[] mixins = {new AOPProxyFactoryMixin(SimpleMixin.class, new Class[]{Simple.class})};
      Object proxy = assertCreateHollowProxy(mixins, null, Simple.class);

      Simple simple = (Simple)proxy;
      simple.doSomething();
      assertTrue(SimpleMixin.invoked);
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

   {
      SimpleMixinWithConstructorAndDelegate.invoked = false;
      SimpleMixinWithConstructorAndDelegate.proxy = null;
      SimpleMixinWithConstructorAndDelegate.delegate = null;

      AOPProxyFactoryMixin[] mixins = {new AOPProxyFactoryMixin(SimpleMixinWithConstructorAndDelegate.class, new Class[]{Simple.class}, "this")};
      Object proxy = assertCreateHollowProxy(mixins, null, Simple.class);

      System.out.println(SimpleMixinWithConstructorAndDelegate.delegate);
      Simple simple = (Simple)proxy;
      simple.doSomething();
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

   public void testSimpleMixinDefaultConstructor() throws Exception
   {
      SimpleMixin.invoked = false;

      PlainBean bean = new PlainBean();
      AOPProxyFactoryMixin[] mixins = {new AOPProxyFactoryMixin(SimpleMixin.class, new Class[]{Simple.class})};
      Object proxy = assertCreateProxy(bean, mixins, Simple.class);

      Simple simple = (Simple)proxy;
      simple.doSomething();
      assertTrue(SimpleMixin.invoked);
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

      SimpleMixinWithConstructorAndDelegate.invoked = false;
      SimpleMixinWithConstructorAndDelegate.proxy = null;
      SimpleMixinWithConstructorAndDelegate.delegate = null;

      PlainBean bean = new PlainBean();
      AOPProxyFactoryMixin[] mixins = {new AOPProxyFactoryMixin(SimpleMixinWithConstructorAndDelegate.class, new Class[]{Simple.class}, "this")};
      Object proxy = assertCreateProxy(bean, mixins, Simple.class);

      Simple simple = (Simple)proxy;
      simple.doSomething();
      assertTrue(SimpleMixinWithConstructorAndDelegate.invoked);
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

      ReturningInterceptor.invoked = null;
      AnotherMixin.invoked = false;

      PlainBean bean = new PlainBean();
      AOPProxyFactoryMixin[] mixins = {
            new AOPProxyFactoryMixin(SimpleMixin.class, new Class[]{Simple.class}),
            new AOPProxyFactoryMixin(AnotherMixin.class, new Class[] {Another.class})};
      Object proxy = assertCreateProxy(
            bean,
            new Class[] {Other.class, Tagging.class},
            mixins,
            new Class[] {Other.class, Simple.class, Tagging.class, Another.class});
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

      AspectXmlLoader.deployXML(url);
     
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setTarget(tgt);
      params.setInterfaces(new Class[] {SomeInterface.class});
      params.setMixins(new AOPProxyFactoryMixin[] {new AOPProxyFactoryMixin(Mixin.class, new Class<?>[] {MixinInterface.class})});
      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      Proxied proxied = (Proxied)factory.createAdvisedProxy(params);
     
      SimpleInterceptor.intercepted = false;
      proxied.someMethod();
View Full Code Here

Examples of org.jboss.aop.proxy.container.AOPProxyFactoryMixin

   public void testMixins() throws Exception
   {
      Base base = new Base();
      AOPProxyFactoryMixin[] mixins = {
            new AOPProxyFactoryMixin(OtherMixinImpl.class, new Class[] {OtherMixin.class}),
            new AOPProxyFactoryMixin(SomeMixinImpl.class, new Class[] {SomeMixin.class}),
      };
      Object proxy = assertCreateProxy(base, null, mixins, new Class[] {OtherMixin.class, SomeMixin.class});
      assertTrue(proxy instanceof Advised);
      assertTrue(proxy instanceof AspectManaged);
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.