Examples of AOPProxyFactoryParameters


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

    * @return the proxy
    * @throws Exception for any error
    */
   protected Object createHollowProxy(AOPProxyFactoryMixin[] mixins, SimpleMetaData metaData) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setMixins(mixins);
      params.setSimpleMetaData(metaData);
      return proxyFactory.createAdvisedProxy(params);
   }
View Full Code Here

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

    * @return the proxy
    * @throws Exception for any error
    */
   protected Object createHollowProxy(Class[] interfaces, AOPProxyFactoryMixin[] mixins, SimpleMetaData metaData) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setInterfaces(interfaces);
      params.setMixins(mixins);
      params.setSimpleMetaData(metaData);
      return proxyFactory.createAdvisedProxy(params);
   }
View Full Code Here

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

            "advice",
            "execution(* $instanceof{" + SomeInterface.class.getName() + "}->helloWorld(..))");

     
        
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setInterfaces(new Class[] {SomeInterface.class});
      params.setMixins(new AOPProxyFactoryMixin[] {
            new AOPProxyFactoryMixin(OtherMixin.class, new Class[] {OtherMixinInterface.class, OtherMixinInterface2.class}, "20")
      });
     
      params.setTarget(new SerializablePOJO());
      AOPProxyFactory factory = new GeneratedAOPProxyFactory();
      SomeInterface si = (SomeInterface)factory.createAdvisedProxy(params);
     
      TestAspect.invoked = false;
      TestAspect2.invoked = false;
View Full Code Here

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

            Scope.PER_VM,
            TestAspect2.class.getName(),
            "advice",
            "execution(* $instanceof{" + SomeInterface.class.getName() + "}->otherWorld(..))");
        
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setInterfaces(new Class[] {SomeInterface.class});
      params.setMixins(new AOPProxyFactoryMixin[] {
            new AOPProxyFactoryMixin(OtherMixin.class, new Class[] {OtherMixinInterface.class, OtherMixinInterface2.class}, "20")
      });
     
      params.setTarget(new SerializablePOJO());
      AOPProxyFactory factory = new GeneratedAOPProxyFactory();
      SomeInterface si = (SomeInterface)factory.createAdvisedProxy(params);
     
      TestAspect.invoked = false;
      TestAspect2.invoked = false;
View Full Code Here

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

      }
   }
  
   private Object assertMakeContainerProxy(Class<?> parent, ClassLoader loader) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setProxiedClass(parent);
      params.setTarget(parent.newInstance());
      params.setClassLoader(loader);
      params.setInterfaces(new Class<?>[] {java.io.Serializable.class});
      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      Object proxy = factory.createAdvisedProxy(params);
      assertFalse(parent.getName() == proxy.getClass().getName());
      assertSame(loader, proxy.getClass().getClassLoader());
      return proxy;
View Full Code Here

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

      }
   }
  
   private Object assertMakeContainerProxy(Class<?> parent, ClassLoader loader) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setProxiedClass(parent);
      params.setTarget(parent.newInstance());
      params.setClassLoader(loader);
      params.setInterfaces(new Class<?>[] {java.io.Serializable.class});
      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      Object proxy = factory.createAdvisedProxy(params);
      assertFalse(parent.getName() == proxy.getClass().getName());
      assertSame(loader, proxy.getClass().getClassLoader());
      return proxy;
View Full Code Here

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

  
  
   public void testHollowProxyWithInterfaceContainingObjectMethods() throws Exception
   {
      //Here to verify that we do not "crash" with methods already in the proxy class (toString(), equals() and hashCode() all exist in the template)
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setObjectAsSuperClass(true);
      params.setInterfaces(new Class[] {OverrideObjectInterface.class});
     
      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      Object o = factory.createAdvisedProxy(params);
      assertTrue(o instanceof OverrideObjectInterface);
View Full Code Here

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

         manager.addAspectDefinition(def);
         manager.addInterceptorFactory(advice.getName(), advice);
         manager.addPointcut(pointcut);
         manager.addBinding(binding);
        
         AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
         params.setInterfaces(new Class[] {SomeInterface.class});
         params.setTarget(new POJO());
        
         GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
         SomeInterface si = (SomeInterface)factory.createAdvisedProxy(params);
        
         si.helloWorld();
View Full Code Here

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

         manager.addAspectDefinition(def);
         manager.addInterceptorFactory(advice.getName(), advice);
         manager.addPointcut(pointcut);
         manager.addBinding(binding);
        
         AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
         params.setInterfaces(new Class[] {SomeInterface.class});
         params.setTarget(new POJO());
        
         GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
         SomeInterface si = (SomeInterface)factory.createAdvisedProxy(params);
        
         si.helloWorld();
View Full Code Here

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

   }
  
   @SuppressWarnings("unchecked")
   public void testAnnotationsExistInProxy() throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setInterfaces(new Class[]{SomeInterface.class});
      params.setTarget(new AnnotatedPOJO());
     
      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      AnnotatedPOJO pojo = (AnnotatedPOJO)factory.createAdvisedProxy(params);
     
      Class proxyClass = pojo.getClass();
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.