Package org.jboss.cache.aop

Examples of org.jboss.cache.aop.PojoCache.activateRegion()


   public void testPartialStateTransfer() throws Exception
   {
      log.info("Enter testPartialStateTransfer");
     
      PojoCache cache1 = createCache("cache1", false, true, false);
      cache1.activateRegion("/a");

      cache1.putObject(A_B_1, joe);
      cache1.putObject(A_B_2, jane);

      PojoCache cache2 = createCache("cache2", false, true, false);
View Full Code Here


      {cache1, cache2}, 60000);
     
      assertNull("/a/b/1 not transferred per policy", cache2.getObject(A_B_1));
      assertNull("/a/b/2 not transferred per policy", cache2.getObject(A_B_2));

      cache2.activateRegion("/a/b");
     
      Person ab1  = (Person) cache2.getObject(A_B_1);
      Person ab2 = (Person) cache2.getObject(A_B_2);
      assertEquals("Name for /a/b/1 is Joe", joe.getName(), ab1.getName());
      assertEquals("City for /a/b/1 is Anytown", joe.getAddress().getCity(), ab1.getAddress().getCity());
View Full Code Here

      cache1.putObject(A_C_1, bob);
      cache1.putObject(A_C_2, jill);
     
      assertNull("/a/c/1 not transferred per policy", cache2.getObject(A_C_1));

      cache2.activateRegion("/a/c");
     
      Person ac1 = (Person) cache2.getObject(A_C_1);
      Person ac2 = (Person) cache2.getObject(A_C_2);
      assertEquals("Name for /a/c/1 is Bob", bob.getName(), ac1.getName());
      assertEquals("City for /a/c/1 is Fremont", addr2.getCity(), ac1.getAddress().getCity());
View Full Code Here

   public void testPartialStateTransferWithLoader() throws Exception
  
      log.info("Enter testPartialStateTransferWithLoader");
     
      PojoCache cache1 = createCache("cache1", false, true, true);
      cache1.activateRegion("/a");

      cache1.putObject(A_B_1, joe);
      cache1.putObject(A_B_2, jane);

      PojoCache cache2 = createCache("cache2", false, true, true);
View Full Code Here

         assertNull("/a/b/1 age not transferred per policy", map.get("age"));
      }
      assertNull("/a/b/1 not transferred per policy", cache2.getObject(A_B_1));
      assertNull("/a/b/2 not transferred per policy", cache2.getObject(A_B_2));

      cache2.activateRegion("/a/b");

      assertEquals("Correct name from loader for /a/b/1", joe.getName(), loader.get(A_B_1).get("name"));
      assertEquals("Correct age from loader for /a/b/1", TWENTY, loader.get(A_B_1).get("age"));
      assertEquals("Correct name from loader for /a/b/2", jane.getName(), loader.get(A_B_2).get("name"));
      assertEquals("Correct age from loader for /a/b/2", TWENTYFIVE, loader.get(A_B_2).get("age"));
View Full Code Here

      cache1.putObject(A_C_1, bob);
      cache1.putObject(A_C_2, jill);
     
      assertNull("/a/c/1 not transferred per policy", cache2.getObject(A_C_1));

      cache2.activateRegion("/a/c");

      assertEquals("Correct name from loader for /a/b/1", joe.getName(), loader.get(A_B_1).get("name"));
      assertEquals("Correct age from loader for /a/b/1", TWENTY, loader.get(A_B_1).get("age"));
      assertEquals("Correct name from loader for /a/b/2", jane.getName(), loader.get(A_B_2).get("name"));
      assertEquals("Correct age from loader for /a/b/2", TWENTYFIVE, loader.get(A_B_2).get("age"));
View Full Code Here

           
            // Activate cacheA
            for (int i = 0; i < count; i++)
            {
               log.info("TEST: Activating /" + names[i] + " on A");
               cacheA.activateRegion("/" + names[i]);
               // Stop the stressor so we don't pollute cacheA's state
               // with too many messages sent after activation -- we want
               // to compare transferred state with the sender
               stressors[i].stopPuts();
               log.info("TEST: Run " + x + "-- /" + names[i] + " activated on A");
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.