Package org.jboss.cache.aop

Examples of org.jboss.cache.aop.PojoCache


      cache1.remove("/");
      cache1.stop();
   }

   private PojoCache createCache(String name) throws Exception {
      PojoCache tree = new PojoCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(tree, "META-INF/replSync-service.xml"); // read in generic replAsync xml
      tree.setClusterName(name);
      tree.createService();
      tree.startService();
      return tree;
   }
View Full Code Here


   protected void setUp() throws Exception
   {
      super.setUp();
      log.info("setUp() ....");
      String configFile = "META-INF/local-service.xml";
      cache_ = new PojoCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(cache_, configFile); // read in generic replSync xml
      cache_.start();

      stage();
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
      log.info("setUp() ....");
      String configFile = "META-INF/local-service.xml";
      cache_ = new PojoCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(cache_, configFile); // read in generic replSync xml
      cache_.start();

      stage();
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
      log.info("setUp() ....");
      treeCache = new PojoCache();

      PropertyConfigurator cacheConfig = new PropertyConfigurator();
      cacheConfig.configure(treeCache, CONFIG_FILENAME);
      treeCache.startService();
      treeCache.putObject("/aop/test", new HashMap());
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
      Properties prop = new Properties();
      prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
      cache_ = new PojoCache();
      PropertyConfigurator config = new PropertyConfigurator(); // configure tree cache.
      config.configure(cache_, "META-INF/replSync-service.xml");

      cache1_ = new PojoCache();
      config.configure(cache1_, "META-INF/replSync-service.xml");
      cache_.start();
      cache1_.start();
   }
View Full Code Here

   }

   void initCaches() throws Exception
   {
//      sleep(10000);
      cache_ = new PojoCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(cache_, "META-INF/local-aop-eviction-service.xml"); // read in generic local xml
      cache_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      cache_.startService();
   }
View Full Code Here

        return createCache(false, numBuddies, buddyPoolName, useDataGravitation, removeOnFind, start);
    }

    protected PojoCache createCache(boolean optimisticLocks, int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean removeOnFind, boolean start) throws Exception
    {
        PojoCache c = new PojoCache();
        c.setCacheMode(TreeCache.REPL_SYNC);
        c.setClusterName("BuddyReplicationTest");
        // basic config
        String xmlString = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled>\n" +
                "<buddyCommunicationTimeout>600000</buddyCommunicationTimeout>\n" +
                "          <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>\n" +
                "          <autoDataGravitation>"+useDataGravitation+"</autoDataGravitation>\n" +
                "          <dataGravitationRemoveOnFind>"+removeOnFind+"</dataGravitationRemoveOnFind>\n" +
                "          <dataGravitationSearchSubtrees>true</dataGravitationSearchSubtrees>\n" +
                "          <buddyLocatorProperties>numBuddies = "+numBuddies+"</buddyLocatorProperties>\n";

        if (buddyPoolName != null) xmlString += "<buddyPoolName>"+buddyPoolName+"</buddyPoolName>";
        xmlString += "</config>";
        c.setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );

        c.setFetchInMemoryState(true);
        if (optimisticLocks)
        {
            c.setNodeLockingScheme("OPTIMISTIC");
        }
        c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
        c.setSyncCommitPhase(true); // helps track down breakages

        if (start)
           c.startService();
        return c;
    }
View Full Code Here

        return caches;
    }

    protected PojoCache createCacheWithCacheLoader(String location, boolean useDataGravitation, boolean removeOnFind, boolean passivation, boolean fetchPersistent, boolean start) throws Exception
    {
       PojoCache cache = createCache(1, null, useDataGravitation, removeOnFind, false);

       String cloader = "<config>\n" +
           "<passivation>"+passivation+"</passivation>\n" +
           "<preload></preload>\n" +

           "<cacheloader>\n" +
           "<class>org.jboss.cache.loader.FileCacheLoader</class>\n" +
           "<properties>location=" +(location)+ "</properties>\n" +
           "<async>false</async>\n" +
           "<shared>false</shared>\n" +
           "<fetchPersistentState>"+ fetchPersistent + "</fetchPersistentState>\n" +
           "</cacheloader>\n" +
           "</config>";

       cache.setCacheLoaderConfiguration(XmlHelper.stringToElement(cloader));
       if (start)
          cache.startService();

       return cache;
    }
View Full Code Here

   {
      super.setUp();
   }

    private void startTest() throws Exception {
        cache = new PojoCache();
        cache.setCacheMode(TreeCache.LOCAL);
        cache.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
        cache.setTransactionManagerLookup(new DummyTransactionManagerLookup());
        cache.create();
        cache.start();
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
      log_.info("setUp() ....");
      String configFile = "META-INF/local-service.xml";
      cache_ = new PojoCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(cache_, configFile); // read in generic replSync xml
      cache_.start();
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.aop.PojoCache

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.