Package org.jboss.cache.config

Examples of org.jboss.cache.config.BuddyReplicationConfig


      testReplAsync();
   }

   @Test(enabled = false)
   public void testReplSyncOptBR() throws Exception {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      cache.getConfiguration().setBuddyReplicationConfig(brc);
      testReplSyncOptimistic();
   }
View Full Code Here


      testReplSyncOptimistic();
   }

   @Test(enabled = false)
   public void testReplAsyncOptBR() throws Exception {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      cache.getConfiguration().setBuddyReplicationConfig(brc);
      testReplAsyncOptimistic();
   }
View Full Code Here

   public void testBuddyManagerLocal()
   {
      // leaving cache mode as local
      assert c.getBuddyManager() == null;

      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      c.getConfiguration().setBuddyReplicationConfig(brc);

      c.start();
      assert c.getBuddyManager() == null;
   }
View Full Code Here

   {
      // we need to not be LOCAL if we want things to work with BR!
      c.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      assert c.getBuddyManager() == null;

      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      c.getConfiguration().setBuddyReplicationConfig(brc);

      c.start();
      assert c.getBuddyManager() != null;
      assert c.getBuddyManager().isEnabled();
View Full Code Here

    */
   public void testDefaultValues() throws Exception
   {
      String xmlConfig = "<buddyReplication enabled=\"true\"/>";
      Element element = XmlConfigHelper.stringToElementInCoreNS(xmlConfig);
      BuddyReplicationConfig brConfig = parser.parseBuddyElement(element);
      assert brConfig.getBuddyLocatorConfig().getClassName().equals(NextMemberBuddyLocator.class.getName()) : "default buddy locator class is NextMemberBuddyLocator";
      assert brConfig.getBuddyLocatorConfig().getBuddyLocatorProperties().isEmpty();
      assert brConfig.isDataGravitationRemoveOnFind() : "default to true";
      assert brConfig.isDataGravitationSearchBackupTrees() : "default to true";
      assert brConfig.isAutoDataGravitation() : "default to false";
   }
View Full Code Here

            "            numBuddies = 3\n" +
            "         </properties>\n" +
            "      </locator>\n" +
            "   </buddyReplication>";
      Element element = XmlConfigHelper.stringToElementInCoreNS(xmlConfig);
      BuddyReplicationConfig brConfig = parser.parseBuddyElement(element);
      assert brConfig.getBuddyLocatorConfig().getClassName().equals(NextMemberBuddyLocator.class.getName()) : "default buddy locator class is NextMemberBuddyLocator";
      assert brConfig.getBuddyLocatorConfig().getBuddyLocatorProperties().get("numBuddies").equals("3");
      assert brConfig.getBuddyLocatorConfig().getBuddyLocatorProperties().size() == 1;
   }
View Full Code Here

            "            numBuddies = 3\n" +
            "         </properties>\n" +
            "      </locator>\n" +
            "   </buddyReplication>";
      Element element = XmlConfigHelper.stringToElementInCoreNS(xmlConfig);
      BuddyReplicationConfig brConfig = parser.parseBuddyElement(element);
      assert brConfig.isEnabled();
      assert brConfig.getBuddyPoolName().equals("groupOne");
      assert brConfig.getBuddyLocatorConfig().getBuddyLocatorProperties().get("numBuddies").equals("3");
   }
View Full Code Here

      assert first.getProperties().get("cache.jdbc.table.drop").equals("true");
   }

   public void testBuddyReplicationConfig()
   {
      BuddyReplicationConfig brConfig = syncConfig.getBuddyReplicationConfig();
      assert brConfig.isEnabled();
      BuddyReplicationConfig.BuddyLocatorConfig locatorConfig = brConfig.getBuddyLocatorConfig();
      assert "org.jboss.cache.buddyreplication.NextMemberBuddyLocator".equals(locatorConfig.getBuddyLocatorClass());
      assert locatorConfig.getBuddyLocatorProperties().get("numBuddies").equals("1");
      assert locatorConfig.getBuddyLocatorProperties().get("ignoreColocatedBuddies").equals("true");
      assert brConfig.getBuddyPoolName().equals("myBuddyPoolReplicationGroup");
      assert brConfig.getBuddyCommunicationTimeout() == 2000;
      assert brConfig.isAutoDataGravitation();
      assert brConfig.isDataGravitationRemoveOnFind();
      assert brConfig.isDataGravitationSearchBackupTrees();
   }
View Full Code Here

      this.batchingManager = new BatchingManagerImpl(tm);
     
      Object[] objs = new Object[]{SESSION, hostName_, webAppPath_};
      Fqn pathFqn = Fqn.fromList(Arrays.asList(objs), true);
     
      BuddyReplicationConfig brc = plainCache_.getConfiguration().getBuddyReplicationConfig();
      this.useBuddyReplication_ = brc != null && brc.isEnabled();
      if (useTreeCacheMarshalling_ || this.useBuddyReplication_)
      {
         // JBAS-5628/JBAS-5629 -- clean out persistent store
         cleanWebappRegion(pathFqn);
      }
View Full Code Here

         {
            log_.error("Exception during inactivation of webapp region " + pathFqn +
                       " or un-registration of its class loader", e);
         }
      }
      BuddyReplicationConfig brc = plainCache_.getConfiguration().getBuddyReplicationConfig();
      this.useBuddyReplication_ = brc != null && brc.isEnabled();
      if (useTreeCacheMarshalling_ || this.useBuddyReplication_)
      {
         // JBAS-5628/JBAS-5629 -- clean out persistent store
         cleanWebappRegion(pathFqn);
      }
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.BuddyReplicationConfig

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.