Package org.jboss.cache.config

Examples of org.jboss.cache.config.BuddyReplicationConfig


   public void setUp() throws CloneNotSupportedException
   {
      UnitTestCacheFactory cf = new UnitTestCacheFactory<Object, Object>();
      Configuration conf = new Configuration();
      conf.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      conf.setBuddyReplicationConfig(brc);

      c1 = cf.createCache(conf, false, getClass());
      c2 = cf.createCache(conf.clone(), false, getClass());
      c3 = cf.createCache(conf.clone(), false, getClass());
View Full Code Here


      this.tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      if (tm == null)
      {
         throw new IllegalStateException("tm is null");
      }
      BuddyReplicationConfig brc = cache.getConfiguration().getBuddyReplicationConfig();
      this.buddyReplication = brc != null && brc.isEnabled();     
   }
View Full Code Here

      assertEquals("UseReplQueue", true, c.isUseReplQueue());

      assertEquals("ClusterConfig", getClusterConfig().toString(), wrapper.getClusterConfig().toString());

      assertEquals("BuddyReplicationConfig", getBuddyReplicationConfig(legacy).toString(), wrapper.getBuddyReplicationConfig().toString());
      BuddyReplicationConfig brc = c.getBuddyReplicationConfig();
      assertEquals("BR enabled", true, brc.isEnabled());
      assertEquals("BR auto grav", false, brc.isAutoDataGravitation());
      assertEquals("BR remove find", false, brc.isDataGravitationRemoveOnFind());
      assertEquals("BR search backup", false, brc.isDataGravitationSearchBackupTrees());
      assertEquals("BR comm timeout", 600000, brc.getBuddyCommunicationTimeout());
      assertEquals("BR poolname", "testpool", brc.getBuddyPoolName());
      BuddyLocatorConfig blc = brc.getBuddyLocatorConfig();
      assertEquals("BR locator", "org.jboss.cache.buddyreplication.TestBuddyLocator", blc.getBuddyLocatorClass());
      Properties props = blc.getBuddyLocatorProperties();
      assertEquals("BR props", "2", props.get("numBuddies"));

      assertEquals("CacheLoaderConfig", getCacheLoaderConfig(legacy).toString(), wrapper.getCacheLoaderConfig().toString());
View Full Code Here

         config.setCacheLoaderConfig(clc);
      }
     
      if (!local && !totalReplication)
      {
         BuddyReplicationConfig brc = new BuddyReplicationConfig();
         brc.setEnabled(true);
         NextMemberBuddyLocatorConfig blc = new NextMemberBuddyLocatorConfig();
         blc.setNumBuddies(1);
         blc.setIgnoreColocatedBuddies(true);
         brc.setBuddyLocatorConfig(blc);
        
         brc.setBuddyPoolName("default");
         brc.setBuddyCommunicationTimeout(20000);
         brc.setAutoDataGravitation(false);
         brc.setDataGravitationRemoveOnFind(true);
         brc.setDataGravitationSearchBackupTrees(true);
        
         config.setBuddyReplicationConfig(brc);
      }
     
      return config;
View Full Code Here

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

      return getConfiguration().isInactiveOnStartup();
   }

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

   public BuddyReplicationConfig parseBuddyElement(Element element)
   {
      assertNotLegacyElement(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

      }
      this.batchingManager = new BatchingManagerImpl(tm);
     
      Fqn<String> pathFqn = Fqn.fromElements(SESSION, combinedPath_);
     
      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

      assertEquals("UseReplQueue", true, c.isUseReplQueue());

      assertEquals("ClusterConfig", getClusterConfig().toString(), wrapper.getClusterConfig().toString());

      assertEquals("BuddyReplicationConfig", getBuddyReplicationConfig().toString(), wrapper.getBuddyReplicationConfig().toString());
      BuddyReplicationConfig brc = c.getBuddyReplicationConfig();
      assertEquals("BR enabled", true, brc.isEnabled());
      assertEquals("BR auto grav", false, brc.isAutoDataGravitation());
      assertEquals("BR remove find", false, brc.isDataGravitationRemoveOnFind());
      assertEquals("BR search backup", false, brc.isDataGravitationSearchBackupTrees());
      assertEquals("BR comm timeout", 600000, brc.getBuddyCommunicationTimeout());
      assertEquals("BR poolname", "testpool", brc.getBuddyPoolName());
      BuddyLocatorConfig blc = brc.getBuddyLocatorConfig();
      assertEquals("BR locator", "org.jboss.cache.buddyreplication.TestBuddyLocator", blc.getBuddyLocatorClass());
      Properties props = blc.getBuddyLocatorProperties();
      assertEquals("BR props", "2", props.get("numBuddies"));

      assertEquals("CacheLoaderConfig", getCacheLoaderConfig().toString(), wrapper.getCacheLoaderConfig().toString());
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.