Examples of insertInterceptor()


Examples of org.jboss.aop.ClassInstanceAdvisor.insertInterceptor()

      Class<?>[] mixIntfs = {MixinInterface.class};
      ProxyMixin mixin = new ProxyMixin(new Mixin(), mixIntfs);
      ProxyMixin[] mixins = {mixin};
      Class<?>[] intfs = {SomeInterface.class};
      ClassInstanceAdvisor advisor = new ClassInstanceAdvisor();
      advisor.insertInterceptor(new EchoInterceptor());

      /*
      CtClass clazz = ProxyFactory.createProxyCtClass(Thread.currentThread().getContextClassLoader(), mixins, intfs);
      FileOutputStream fo = new FileOutputStream(clazz.getName() + ".class");
      DataOutputStream dos = new DataOutputStream(fo);
View Full Code Here

Examples of org.jboss.aop.ClassInstanceAdvisor.insertInterceptor()

   {
      Class<?>[] mixIntfs = {MixinInterface.class};
      ProxyMixin mixin = new ProxyMixin(new Mixin(), mixIntfs);
      ProxyMixin[] mixins = {mixin};
      ClassInstanceAdvisor advisor = new ClassInstanceAdvisor();
      advisor.insertInterceptor(new EchoInterceptor());
      POJO proxy = (POJO) ClassProxyFactory.newInstance(POJO.class, mixins, advisor);

      /*
      CtClass clazz = ClassProxyFactory.createProxyCtClass(mixins, POJO.class);
      FileOutputStream fo = new FileOutputStream(clazz.getName() + ".class");
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

      else
      {
         clazz = obj.getClass();
         ClassProxy proxy = ClassProxyFactory.newInstance(obj.getClass());
         advisor = proxy._getInstanceAdvisor();
         advisor.insertInterceptor(new ForwardingInterceptor(obj));
         Dispatcher.singleton.registerTarget(objectId, proxy);
      }
      families = (Map) advisor.getMetaData().getMetaData(CLUSTERED_REMOTING, CLUSTER_FAMILIES);
      if (families != null)
      {
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

      {
         families = new HashMap();
         target = new HATarget(partition, proxyFamilyName, locator, HATarget.ENABLE_INVOCATIONS);
         ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicantList());
         families.put(proxyFamilyName, target);
         advisor.insertInterceptor(0, new ReplicantsManagerInterceptor(families));
      }

      ClassProxy proxy = ClassProxyFactory.newInstance(clazz);
      InstanceAdvisor proxyAdvisor = proxy._getInstanceAdvisor();
      proxyAdvisor.insertInterceptor(IsLocalInterceptor.singleton);
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

         advisor.insertInterceptor(0, new ReplicantsManagerInterceptor(families));
      }

      ClassProxy proxy = ClassProxyFactory.newInstance(clazz);
      InstanceAdvisor proxyAdvisor = proxy._getInstanceAdvisor();
      proxyAdvisor.insertInterceptor(IsLocalInterceptor.singleton);
      advisor.insertInterceptor(SecurityClientInterceptor.singleton);
      advisor.insertInterceptor(ClientTxPropagationInterceptor.singleton);
      proxyAdvisor.insertInterceptor(MergeMetaDataInterceptor.singleton);
      proxyAdvisor.insertInterceptor(ClusterChooserInterceptor.singleton);
      proxyAdvisor.insertInterceptor(InvokeRemoteInterceptor.singleton);
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

      ClassProxy proxy = ClassProxyFactory.newInstance(clazz);
      InstanceAdvisor proxyAdvisor = proxy._getInstanceAdvisor();
      proxyAdvisor.insertInterceptor(IsLocalInterceptor.singleton);
      advisor.insertInterceptor(SecurityClientInterceptor.singleton);
      advisor.insertInterceptor(ClientTxPropagationInterceptor.singleton);
      proxyAdvisor.insertInterceptor(MergeMetaDataInterceptor.singleton);
      proxyAdvisor.insertInterceptor(ClusterChooserInterceptor.singleton);
      proxyAdvisor.insertInterceptor(InvokeRemoteInterceptor.singleton);

      proxyAdvisor.getMetaData().addMetaData(CLUSTERED_REMOTING,
      CLUSTER_FAMILY_WRAPPER,
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

      InstanceAdvisor proxyAdvisor = proxy._getInstanceAdvisor();
      proxyAdvisor.insertInterceptor(IsLocalInterceptor.singleton);
      advisor.insertInterceptor(SecurityClientInterceptor.singleton);
      advisor.insertInterceptor(ClientTxPropagationInterceptor.singleton);
      proxyAdvisor.insertInterceptor(MergeMetaDataInterceptor.singleton);
      proxyAdvisor.insertInterceptor(ClusterChooserInterceptor.singleton);
      proxyAdvisor.insertInterceptor(InvokeRemoteInterceptor.singleton);

      proxyAdvisor.getMetaData().addMetaData(CLUSTERED_REMOTING,
      CLUSTER_FAMILY_WRAPPER,
      new FamilyWrapper(proxyFamilyName, target.getReplicantList()),
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

      proxyAdvisor.insertInterceptor(IsLocalInterceptor.singleton);
      advisor.insertInterceptor(SecurityClientInterceptor.singleton);
      advisor.insertInterceptor(ClientTxPropagationInterceptor.singleton);
      proxyAdvisor.insertInterceptor(MergeMetaDataInterceptor.singleton);
      proxyAdvisor.insertInterceptor(ClusterChooserInterceptor.singleton);
      proxyAdvisor.insertInterceptor(InvokeRemoteInterceptor.singleton);

      proxyAdvisor.getMetaData().addMetaData(CLUSTERED_REMOTING,
      CLUSTER_FAMILY_WRAPPER,
      new FamilyWrapper(proxyFamilyName, target.getReplicantList()),
      PayloadKey.AS_IS);
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

   public static void makeRemotable(InstanceAdvised proxy, InvokerLocator locator,
         Object objectId, List<Interceptor> interceptors, String subsystem)
   {
      InstanceAdvisor advisor = proxy._getInstanceAdvisor();
      for(Interceptor i : interceptors)
         advisor.insertInterceptor(i);
      advisor.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING,
         InvokeRemoteInterceptor.INVOKER_LOCATOR,
         locator,
         PayloadKey.AS_IS);
      advisor.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING,
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.insertInterceptor()

         assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(0));

         System.out.println("---- Adding more interceptors");

         InstanceAdvisor pojoIa1 = ((Advised)pojo1)._getInstanceAdvisor();
         pojoIa1.insertInterceptor(new MyInterceptor());

         Interceptions.clear();
         pojo1.someMethod(123);
         assertEquals(2, Interceptions.size());
         assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));
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.