Examples of BuddyReplicationConfig


Examples of org.jboss.cache.config.BuddyReplicationConfig

      }
   }

   private BuddyReplicationConfig getBuddyConfig() throws Exception
   {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      brc.setAutoDataGravitation(false);
      return brc;
   }
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

   private Cache<String, Integer> cache2;

   @BeforeMethod
   public void setUp() throws Exception
   {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      brc.setBuddyCommunicationTimeout(1000);
      brc.setAutoDataGravitation(true);
      brc.setDataGravitationRemoveOnFind(true);
      brc.setDataGravitationSearchBackupTrees(true);
      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      c.setBuddyReplicationConfig(brc);

      // Cache1 will be used only for recovery.
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

      CacheSPI<Object, Object> c = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC, false, false, true), false);

      String threadId = Thread.currentThread().getName();     
      //c.getConfiguration().setClusterName("BuddyReplicationTest-" + threadId);

      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      if (buddyPoolName != null) brc.setBuddyPoolName(buddyPoolName);
      brc.setEnabled(true);
      brc.setBuddyCommunicationTimeout(500000);
      brc.setDataGravitationRemoveOnFind(removeOnFind);
      brc.setDataGravitationSearchBackupTrees(true);
      brc.setAutoDataGravitation(useDataGravitation);
      NextMemberBuddyLocatorConfig nextMemberBuddyLocatorConfig = new NextMemberBuddyLocatorConfig();
      nextMemberBuddyLocatorConfig.setNumBuddies(numBuddies);
      brc.setBuddyLocatorConfig(nextMemberBuddyLocatorConfig);
      c.getConfiguration().setBuddyReplicationConfig(brc);

      c.getConfiguration().setFetchInMemoryState(true);
      c.getConfiguration().setNodeLockingScheme(optimisticLocks ? NodeLockingScheme.OPTIMISTIC : getNonOptimisticLockingScheme());
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

    */
   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

Examples of org.jboss.cache.config.BuddyReplicationConfig

            "            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

Examples of org.jboss.cache.config.BuddyReplicationConfig

            "            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

Examples of org.jboss.cache.config.BuddyReplicationConfig

   private void configureBuddyReplication(Element element)
   {
      if (element == null) return;//buddy config might not exist, expect that
      BuddyElementParser buddyElementParser = new BuddyElementParser();
      BuddyReplicationConfig brConfig = buddyElementParser.parseBuddyElement(element);
      config.setBuddyReplicationConfig(brConfig);
   }
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

*/
public class BuddyElementParser extends XmlParserBase
{
   public BuddyReplicationConfig parseBuddyElement(Element element)
   {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      String enabled = getAttributeValue(element, "enabled");
      brc.setEnabled(getBoolean(enabled));
      String buddyPoolName = getAttributeValue(element, "poolName");
      if (existsAttribute(buddyPoolName)) brc.setBuddyPoolName(buddyPoolName);
      String buddyCommunicationTimeout = getAttributeValue(element, "communicationTimeout");
      if (existsAttribute(buddyCommunicationTimeout))
         brc.setBuddyCommunicationTimeout(getInt(buddyCommunicationTimeout));

      parseDataGravitationElement(getSingleElementInCoreNS("dataGravitation", element), brc);
      BuddyReplicationConfig.BuddyLocatorConfig blc = parseBuddyLocatorConfig(getSingleElementInCoreNS("locator", element));
      brc.setBuddyLocatorConfig(blc);
      return brc;
   }
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

      return getConfiguration().isInactiveOnStartup();
   }

   public void setBuddyReplicationConfig(Element config)
   {
      BuddyReplicationConfig brc = null;
      if (config != null)
      {
         brc = buddyElementParser.parseBuddyElement(config);
      }
      getConfiguration().setBuddyReplicationConfig(brc);
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

      {
         String propname = entry.getKey();
         if ("BuddyReplicationConfiguration".equals(propname)
               || "BuddyReplicationConfig".equals(propname))
         {
            BuddyReplicationConfig brc = parseBuddyReplicationConfig(entry.getValue());
            conf.setBuddyReplicationConfig(brc);
         }
         else if ("CacheLoaderConfiguration".equals(propname)
               || "CacheLoaderConfig".equals(propname))
         {
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.