Package org.jboss.cache

Examples of org.jboss.cache.Region


      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

      cache2.start();

      classLoader = getClassLoader();
      if (!useMarshalledValues)
      {
         Region r1 = cache1.getRegion(fqn, true);
         r1.setActive(true);
         r1.registerContextClassLoader(classLoader);
         Region r2 = cache2.getRegion(fqn, true);
         r2.setActive(true);
         r2.registerContextClassLoader(classLoader);
      }

      listClass = classLoader.loadClass(className);
      value = listClass.newInstance();
View Full Code Here

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

      if (!useMarshalledValues)
      {
         Region existing = cache1.getRegion(aop, true);
         existing.registerContextClassLoader(cla);
         existing = cache2.getRegion(aop, true);
         existing.registerContextClassLoader(clb);
      }

      if (useMarshalledValues) Thread.currentThread().setContextClassLoader(cla);
      replListener2.expect(PessPutKeyValueCommand.class);
      cache1.put(aop, "person", 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

      assertNull("/a/b not transferred to cache", cache2.get(A_B, "person"));

      ClassLoader cl2 = getClassLoader();

      //      cache2.registerClassLoader(A, cl2);
      Region r = cache2.getRegion(A, true);
      r.registerContextClassLoader(cl2);

      r.activate();

      assertEquals("Correct state from loader for /a/b", ben.toString(), getUnmarshalled(loader.get(A_B).get("person")).toString());

      assertEquals("Correct state from cache for /a/b", ben.toString(), getUnmarshalled(cache2.get(A_B, "person")).toString());
View Full Code Here

      RegionManager rm = cr.getComponent(RegionManager.class);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
      final Fqn region = Fqn.fromString("/hello");
      Region r = rm.getRegion(region, true);
      r.registerContextClassLoader(this.getClass().getClassLoader());
      cm200.objectToObjectStream(new ClusteredGetCommand(false, null), oos, region);
      oos.close();

      final byte[] stream = baos.toByteArray();
      // so now the stream starts with the Fqn "/hello".
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.