Package org.jboss.aop.proxy.container

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


   {
      Proxied tgt = new Proxied();
      URL url = getURLRelativeToProjectRoot("/src/resources/test/serialization/simple/manual-aop.xml");
      AspectXmlLoader.deployXML(url);

      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setTarget(tgt);
      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      Proxied proxied = (Proxied)factory.createAdvisedProxy(params);
     
      proxied.someMethod();
      assertTrue(SimpleInterceptor.invoked);
View Full Code Here


      Proxied tgt = new Proxied();//Load the class before we deploy the xml that will cause weaving
     
      URL url = getURLRelativeToProjectRoot("/src/resources/test/synthetic/manual-aop.xml");
      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

            1,
            Scope.PER_VM,
            SimpleMetaDataInterceptor.class.getName(),
            "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")
      });
     
      SimpleMetaData data = new SimpleMetaData();
      data.addMetaData("TEST", "value", "metadata");
      params.setSimpleMetaData(data);
     
      params.setTarget(new SerializablePOJO());
      AOPProxyFactory factory = new GeneratedAOPProxyFactory();
      SomeInterface si = (SomeInterface)factory.createAdvisedProxy(params);
     
      SimpleMetaDataInterceptor.data = null;
      si.helloWorld();
View Full Code Here

      AspectManager.instance().removeBinding(name);
   }
  
   private Object createProxy(Object target)
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setProxiedClass(target.getClass());
      params.setTarget(target);
      return proxyFactory.createAdvisedProxy(params);
   }
View Full Code Here

      return proxyFactory.createAdvisedProxy(params);
   }

   protected Object createProxy(Object target, Class<?>[] interfaces) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setProxiedClass(target.getClass());
      params.setInterfaces(interfaces);
      params.setTarget(target);
      return proxyFactory.createAdvisedProxy(params);
   }
View Full Code Here

      AspectManager manager = AspectManager.instance();
      //Add a binding before creating the proxy
      addBinding("one", "all(org.jboss.test.aop.dynamic.POJOProxy)", Interceptor1.class);

      POJOProxy pojo = new POJOProxy();
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setTarget(pojo);

      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      POJOProxy proxy = (POJOProxy)factory.createAdvisedProxy(params);

      reset();
View Full Code Here

      Proxied tgt = new Proxied();//Load the class before we deploy the xml that will cause weaving
     
      URL url = getURLRelativeToProjectRoot("/src/resources/test/nameddomain/manual-aop.xml");
      AspectXmlLoader.deployXML(url);
     
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setTarget(tgt);
      GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
      Proxied proxied = (Proxied)factory.createAdvisedProxy(params);
     
      proxied.someMethod();
     
View Full Code Here

    * @return the proxy
    * @throws Exception for any error
    */
   protected Object createProxy(Object target) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setProxiedClass(target.getClass());
      params.setTarget(target);
      return proxyFactory.createAdvisedProxy(params);
   }
View Full Code Here

    * @return the proxy
    * @throws Exception for any error
    */
   protected Object createProxy(Object target, Class[] interfaces) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setProxiedClass(target.getClass());
      params.setInterfaces(interfaces);
      params.setTarget(target);
      return proxyFactory.createAdvisedProxy(params);
   }
View Full Code Here

    * @return the proxy
    * @throws Exception for any error
    */
   protected Object createProxy(Object target, AOPProxyFactoryMixin[] mixins) throws Exception
   {
      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
      params.setProxiedClass(target.getClass());
      params.setMixins(mixins);
      params.setTarget(target);
      return proxyFactory.createAdvisedProxy(params);
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.proxy.container.AOPProxyFactoryParameters

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.