Package org.jboss.aop.proxy

Examples of org.jboss.aop.proxy.ClassProxy


      metaData.removeMetaData(VERSION_MANAGER, VERSION_ID);
   }

   public List makeVersionedList(List list, ArrayList newObjects) throws Exception
   {
      ClassProxy proxy = ClassProxyFactory.newInstance(list.getClass());
      GUID guid = tag(proxy);
      DistributedListState manager = new DistributedListState(guid, timeout, proxy, list, this, synchManager);
      StateManager.setStateManager(proxy, manager);
      CollectionStateChangeInterceptor interceptor = new CollectionStateChangeInterceptor(manager);
      proxy._getInstanceAdvisor().appendInterceptor(interceptor);
      newObjects.add(manager);
      return (List)proxy;
   }
View Full Code Here


   }


   public Map makeVersionedMap(Map map, ArrayList newObjects) throws Exception
   {
      ClassProxy proxy = ClassProxyFactory.newInstance(map.getClass());
      GUID guid = tag(proxy);
      DistributedMapState manager = new DistributedMapState(guid, timeout, proxy, map, this, synchManager);
      StateManager.setStateManager(proxy, manager);
      CollectionStateChangeInterceptor interceptor = new CollectionStateChangeInterceptor(manager);
      proxy._getInstanceAdvisor().appendInterceptor(interceptor);
      newObjects.add(manager);
      return (Map)proxy;
   }
View Full Code Here

   }


   public Set makeVersionedSet(Set set, ArrayList newObjects) throws Exception
   {
      ClassProxy proxy = ClassProxyFactory.newInstance(set.getClass());
      GUID guid = tag(proxy);
      DistributedSetState manager = new DistributedSetState(guid, timeout, proxy, set, this, synchManager);
      StateManager.setStateManager(proxy, manager);
      CollectionStateChangeInterceptor interceptor = new CollectionStateChangeInterceptor(manager);
      proxy._getInstanceAdvisor().appendInterceptor(interceptor);
      newObjects.add(manager);
      return (Set)proxy;
   }
View Full Code Here

   
  }
 
  public void testSimpleAOPSerialization() throws Exception
  {
    ClassProxy proxy = createPOJOProxy();
    proxy = createPOJOProxy();
       
        BaseClass base = (BaseClass)proxy;
        System.out.println("Result = "+ base.doSomething(1));
       
View Full Code Here

        assertEquals(4,baseNew.doSomething(5));
  }

  public void testSimpleAOPSerializationOnClass() throws Exception
  {
    ClassProxy proxy = createPOJOProxy();
    proxy = createPOJOProxy();
       
        BaseClass base = (BaseClass)proxy;
        System.out.println("Result = "+ base.doSomething(1));
       
        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteout);
        objout.writeObject(proxy.getClass());
        objout.flush();

        SizeBenchmarkTestCase.saveFileNoCheck("/tmp/check.bin",byteout.toByteArray());
       
        JBossObjectInputStream objectInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
        Class baseNew = (Class)objectInput.readObject();
        assertEquals(proxy.getClass(),baseNew);
        //assertEquals(4,baseNew.doSomething(5));
  }
View Full Code Here

        //assertEquals(4,baseNew.doSomething(5));
  }

  public void testSimpleAOPSerializationCollection() throws Exception
  {
    ClassProxy proxy = createArrayListProxy();
    proxy = createArrayListProxy();
       
        ArrayList base = (ArrayList)proxy;
        //base.add("Test");
       
View Full Code Here

       
        //assertEquals(1,baseNew.size());
  }

  private ClassProxy createPOJOProxy() throws Exception {
    ClassProxy proxy = ClassProxyFactory.newInstance(BaseClass.class);
        InstanceAdvisor advisor = proxy._getInstanceAdvisor();
        advisor.appendInterceptor(new LocalInterceptor(new BaseClass()));
    return proxy;
  }
View Full Code Here

        advisor.appendInterceptor(new LocalInterceptor(new BaseClass()));
    return proxy;
  }
 
  private ClassProxy createArrayListProxy() throws Exception {
    ClassProxy proxy = ClassProxyFactory.newInstance(ArrayList.class);
        InstanceAdvisor advisor = proxy._getInstanceAdvisor();
        advisor.appendInterceptor(new LocalInterceptorArrayList(new ArrayList()));
    return proxy;
  }
View Full Code Here

    * Registers this Container with Remoting / AOP Dispatcher
    */
   protected void registerWithAopDispatcher()
   {
      String registrationName = this.getObjectName().getCanonicalName();
      ClassProxy classProxy = new InvokableContextClassProxyHack(this);
     
      // So that Remoting layer can reference this container easily.
      Dispatcher.singleton.registerTarget(registrationName, classProxy);
     
      // Log
View Full Code Here

    */
   @Override
   protected void registerWithAopDispatcher()
   {
      String registrationName = this.getObjectName().getCanonicalName();
      ClassProxy classProxy = new InvokableContextClassProxyHack(this);
     
      // So that Remoting layer can reference this container easily.
      Dispatcher.singleton.registerTarget(registrationName, classProxy);
     
      // Log
View Full Code Here

TOP

Related Classes of org.jboss.aop.proxy.ClassProxy

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.