Package org.jboss.cache

Examples of org.jboss.cache.Region


     
      Node cacheRoot = this.cacheStore.getRoot().addChild(Fqn.fromString("Teiid")); //$NON-NLS-1$
      Node node = cacheRoot.addChild(Fqn.fromString(location));
      node.setResident(true);
     
      Region cacheRegion = this.cacheStore.getRegion(node.getFqn(), true);
      cacheRegion.setEvictionRegionConfig(buildEvictionConfig(node.getFqn(), config));
           
      JBossCache jc = null;
      if (config != null && config.getPolicy().equals(Policy.EXPIRATION)) {
        jc = new ExpirationAwareCache(this.cacheStore, node.getFqn());
      }
View Full Code Here


      PutKeyValueCommand put = new PutKeyValueCommand(null, A_B, "name", "Joe");
      ReplicateCommand replicate = new ReplicateCommand(put);

      rman.setDefaultInactive(true);
      // register A as an inactive marshalling region
      Region region_A = rman.getRegion(A, true);
      region_A.registerContextClassLoader(this.getClass().getClassLoader());
      assertFalse("New regions created should be inactive by default", region_A.isActive());
      cache.stop();
      c.setUseRegionBasedMarshalling(true);
      c.setInactiveOnStartup(true);
      VersionAwareMarshaller testee = createVAMandRestartCache(rman);
View Full Code Here

   {
      switch (marshallingMode)
      {
         case CUSTOM_CLASSLOADER_WITH_REGIONS:
            cache1.getConfiguration().setUseRegionBasedMarshalling(true);
            Region region1 = cache1.getRegion(fqn("/a"), true);
            region1.registerContextClassLoader(customClassLoader);
            cache2.getConfiguration().setUseRegionBasedMarshalling(true);
            Region region2 = cache2.getRegion(fqn("/a"), true);
            region2.registerContextClassLoader(customClassLoader);
            // and carry on to the same setting as DEFAULT_WITHOUT_MARSHALLED_VALUES
         case DEFAULT_WITHOUT_MARSHALLED_VALUES:
            cache1.getConfiguration().setUseLazyDeserialization(false);
            cache2.getConfiguration().setUseLazyDeserialization(false);
            break;
View Full Code Here

      ClassLoader c1 = getClassLoader();
      ClassLoader c2 = getClassLoader();

      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(aop, false) == null ? cache1.getRegion(aop, true) : cache1.getRegion(aop, false);
         r1.registerContextClassLoader(c1);


         Region r2 = cache2.getRegion(aop, false) == null ? cache2.getRegion(aop, true) : cache2.getRegion(aop, false);
         r2.registerContextClassLoader(c2);
      }

      if (useMarshalledValues) Thread.currentThread().setContextClassLoader(c1);
      cache1.put(aop, "person", srtl.ben_);
      if (useMarshalledValues) resetContextClassLoader();
View Full Code Here

      ClassLoader cla = getClassLoader();
      ClassLoader clb = getClassLoader();
      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(aop, false) == null ? cache1.getRegion(aop, true) : cache1.getRegion(aop, false);
         r1.registerContextClassLoader(cla);
         Region r2 = cache2.getRegion(aop, false) == null ? cache2.getRegion(aop, true) : cache2.getRegion(aop, false);
         r2.registerContextClassLoader(clb);
      }
      if (useMarshalledValues) Thread.currentThread().setContextClassLoader(cla);
      cache1.put(aop, "person", srtl.ben_);

      Object ben2;
View Full Code Here

      ClassLoader cla = getClassLoader();
      ClassLoader clb = getClassLoader();
      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(aop, false) == null ? cache1.getRegion(aop, true) : cache1.getRegion(aop, false);
         r1.registerContextClassLoader(cla);
         Region r2 = cache2.getRegion(aop, false) == null ? cache2.getRegion(aop, true) : cache2.getRegion(aop, false);
         r2.registerContextClassLoader(clb);
      }

      if (useMarshalledValues) Thread.currentThread().setContextClassLoader(cla);
      cache1.put(aop, "person", srtl.ben_);
View Full Code Here

      ClassLoader cla = getClassLoader();
      ClassLoader clb = getClassLoader();

      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(aop, false) == null ? cache1.getRegion(aop, true) : cache1.getRegion(aop, false);
         r1.registerContextClassLoader(cla);
         Region r2 = cache2.getRegion(aop, false) == null ? cache2.getRegion(aop, true) : cache2.getRegion(aop, false);
         r2.registerContextClassLoader(clb);
      }

      if (useMarshalledValues) Thread.currentThread().setContextClassLoader(cla);
      cache1.put(aop, "person", srtl.ben_);
View Full Code Here

      ClassLoader cla = getClassLoader();
      ClassLoader clb = getClassLoader();

      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(aop, false) == null ? cache1.getRegion(aop, true) : cache1.getRegion(aop, false);
         r1.registerContextClassLoader(cla);
         Region r2 = cache2.getRegion(aop, false) == null ? cache2.getRegion(aop, true) : cache2.getRegion(aop, false);
         r2.registerContextClassLoader(clb);
      }

      // Create an empty Person loaded by this classloader
      Object scopedBen1 = getPersonFromClassloader(cla);
      // Create another empty Person loaded by this classloader
View Full Code Here

      ClassLoader cla = getClassLoader();
      ClassLoader clb = getClassLoader();

      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(aop, false) == null ? cache1.getRegion(aop, true) : cache1.getRegion(aop, false);
         r1.registerContextClassLoader(cla);

         Region r2 = cache2.getRegion(aop, false) == null ? cache2.getRegion(aop, true) : cache2.getRegion(aop, false);
         r2.registerContextClassLoader(clb);
      }

      if (useMarshalledValues) Thread.currentThread().setContextClassLoader(cla);
      cache1.put(Fqn.fromString("/aop/1"), "person", srtl.ben_);
      cache1.remove(Fqn.fromString("/aop/1"), "person");
View Full Code Here

      ClassLoader cla = getClassLoader();
      ClassLoader clb = getClassLoader();

      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(aop, false) == null ? cache1.getRegion(aop, true) : cache1.getRegion(aop, false);
         r1.registerContextClassLoader(cla);

         Region r2 = cache2.getRegion(aop, false) == null ? cache2.getRegion(aop, true) : cache2.getRegion(aop, false);
         r2.registerContextClassLoader(clb);
      }

      if (useMarshalledValues) Thread.currentThread().setContextClassLoader(cla);
      TransactionManager tm = beginTransaction();
      cache1.put(Fqn.fromString("/aop/1"), "person", srtl.ben_);
View Full Code Here

TOP

Related Classes of org.jboss.cache.Region

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.