Examples of BuddyReplicationConfig


Examples of org.jboss.cache.config.BuddyReplicationConfig

      }
   }

   private static BuddyReplicationConfig parseBuddyReplicationConfig(Element element)
   {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(XmlConfigHelper.readBooleanContents(element, "buddyReplicationEnabled"));
      brc.setDataGravitationRemoveOnFind(XmlConfigHelper.readBooleanContents(element, "dataGravitationRemoveOnFind", true));
      brc.setDataGravitationSearchBackupTrees(XmlConfigHelper.readBooleanContents(element, "dataGravitationSearchBackupTrees", true));
      brc.setAutoDataGravitation(brc.isEnabled() && XmlConfigHelper.readBooleanContents(element, "autoDataGravitation", false));

      String strBuddyCommunicationTimeout = XmlConfigHelper.readStringContents(element, "buddyCommunicationTimeout");
      try
      {
         brc.setBuddyCommunicationTimeout(Integer.parseInt(strBuddyCommunicationTimeout));
      }
      catch (Exception e)
      {
         if (log.isTraceEnabled()) log.trace(e.getMessage());
      }
      finally
      {
         if (log.isDebugEnabled())
         {
            log.debug("Using buddy communication timeout of " + brc.getBuddyCommunicationTimeout() + " millis");
         }
      }
      String buddyPoolName = XmlConfigHelper.readStringContents(element, "buddyPoolName");
      if ("".equals(buddyPoolName))
      {
         buddyPoolName = null;
      }

      brc.setBuddyPoolName(buddyPoolName);

      // now read the buddy locator details

      String buddyLocatorClass = XmlConfigHelper.readStringContents(element, "buddyLocatorClass");
      if (buddyLocatorClass == null || buddyLocatorClass.length() == 0)
      {
         buddyLocatorClass = NextMemberBuddyLocator.class.getName();
      }
      Properties props = null;
      props = XmlConfigHelper.readPropertiesContents(element, "buddyLocatorProperties");
      BuddyLocatorConfig blc = new BuddyLocatorConfig();
      blc.setBuddyLocatorClass(buddyLocatorClass);
      blc.setBuddyLocatorProperties(props);
      brc.setBuddyLocatorConfig(blc);

      return brc;
   }
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

   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

Examples of org.jboss.cache.config.BuddyReplicationConfig

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

Examples of org.jboss.cache.config.BuddyReplicationConfig

      assertInterceptorLinkage(list);
   }

   public void testBuddyReplicationOptLocking() throws Exception
   {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      cache.getConfiguration().setBuddyReplicationConfig(brc);

      cache.getConfiguration().setCacheMode(REPL_SYNC);
      cache.getConfiguration().setNodeLockingScheme(OPTIMISTIC);
      cache.create();// initialise various subsystems such as BRManager
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

      assertInterceptorLinkage(list);
   }

   public void testBuddyReplicationPessLocking() throws Exception
   {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      cache.getConfiguration().setBuddyReplicationConfig(brc);
      cache.getConfiguration().setCacheMode(REPL_SYNC);
      cache.create();// initialise various subsystems such as BRManager
      InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
      List<CommandInterceptor> list = chain.asList();
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

                  "         <properties>\n" +
                  "            numBuddies = 3\n" +
                  "         </properties>\n" +
                  "      </locator>\n" +
                  "   </buddy>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      BuddyManager mgr = new BuddyManager(config);

      assertTrue(mgr.isEnabled());
      assertEquals("groupOne", mgr.getBuddyPoolName());
      assertEquals(NextMemberBuddyLocator.class, mgr.buddyLocator.getClass());
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

                  "         <properties>\n" +
                  "            numBuddies = 3\n" +
                  "         </properties>\n" +
                  "      </locator>\n" +
                  "   </buddy>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      BuddyManager mgr = new BuddyManager(config);

      assertTrue(mgr.isEnabled());
      assertEquals("groupOne", mgr.getBuddyPoolName());
      assertEquals(NextMemberBuddyLocator.class, mgr.buddyLocator.getClass());
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

    * @throws Exception
    */
   public void testConstruction3() throws Exception
   {
      String xmlConfig = "<buddy enabled=\"false\"/>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      BuddyManager mgr = new BuddyManager(config);
      assertTrue(!mgr.isEnabled());
   }
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

    */
   public void testConstruction4() throws Exception
   {
      String xmlConfig = "<buddy enabled=\"true\"/>";

      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      BuddyManager mgr = new BuddyManager(config);

      assertTrue(mgr.isEnabled());
      assertNull(mgr.getBuddyPoolName());
      assertEquals(NextMemberBuddyLocator.class, mgr.buddyLocator.getClass());
View Full Code Here

Examples of org.jboss.cache.config.BuddyReplicationConfig

   {
      BuddyManager bm = null;
      try
      {
         String xmlConfig = "<buddy enabled=\"false\"/>";
         BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
         bm = new BuddyManager(config);
         bm.injectDependencies(null, null, null, null, null, null, null, null, new BuddyFqnTransformer());
         CommandsFactoryImpl commandsFactory = new CommandsFactoryImpl();
         commandsFactory.initialize(null, null, null, null, null, null, null, new Configuration(), null, new BuddyFqnTransformer());
         bm.initFqnTransformer(DUMMY_LOCAL_ADDRESS, commandsFactory);
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.