Examples of registerContextClassLoader()


Examples of org.jboss.cache.Region.registerContextClassLoader()

      Fqn fqn3 = Fqn.fromString("/aop");

      List<Region> expected = new ArrayList<Region>(4);

      Region region = r.getRegion(DEFAULT_REGION, true);
      region.registerContextClassLoader(getClass().getClassLoader());
      assertEquals(DEFAULT_REGION, region.getFqn());
      expected.add(region);

      region = r.getRegion(fqn1, true);
      region.registerContextClassLoader(getClass().getClassLoader());
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      region.registerContextClassLoader(getClass().getClassLoader());
      assertEquals(DEFAULT_REGION, region.getFqn());
      expected.add(region);

      region = r.getRegion(fqn1, true);
      region.registerContextClassLoader(getClass().getClassLoader());
      assertEquals(fqn1, region.getFqn());
      expected.add(region);

      region = r.getRegion(fqn2, true);
      region.registerContextClassLoader(getClass().getClassLoader());
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      region.registerContextClassLoader(getClass().getClassLoader());
      assertEquals(fqn1, region.getFqn());
      expected.add(region);

      region = r.getRegion(fqn2, true);
      region.registerContextClassLoader(getClass().getClassLoader());
      assertEquals(fqn2, region.getFqn());
      expected.add(region);

      region = r.getRegion(fqn3, true);
      region.registerContextClassLoader(getClass().getClassLoader());
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      region.registerContextClassLoader(getClass().getClassLoader());
      assertEquals(fqn2, region.getFqn());
      expected.add(region);

      region = r.getRegion(fqn3, true);
      region.registerContextClassLoader(getClass().getClassLoader());
      assertEquals(fqn3, region.getFqn());
      expected.add(region);

      // should sort these now ...
      Collections.sort(expected);
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      assertEquals("v", caches.get(0).get(f, "k"));
      assertEquals("v", caches.get(1).get(f, "k"));

      // create the region on cache 0, make sure it is marked as a MARSHALLING region by attaching a class loader to it.
      Region region0 = caches.get(0).getRegionManager().getRegion(f, true);
      region0.registerContextClassLoader(this.getClass().getClassLoader()); // just to make sure this is recognised as a marshalling region.
      assertTrue("Should be active by default", region0.isActive());
      // make sure this newly created region is "recognised" as a marshalling region.
      assertTrue(caches.get(0).getRegionManager().getAllRegions(Region.Type.MARSHALLING).contains(region0));

      // now create a region on cache 1, as above.
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      // make sure this newly created region is "recognised" as a marshalling region.
      assertTrue(caches.get(0).getRegionManager().getAllRegions(Region.Type.MARSHALLING).contains(region0));

      // now create a region on cache 1, as above.
      Region region1 = caches.get(1).getRegionManager().getRegion(f, true);
      region1.registerContextClassLoader(this.getClass().getClassLoader()); // just to make sure this is recognised as a marshalling region.
      assertTrue("Should be active by default", region1.isActive());
      // make sure this newly created region is "recognised" as a marshalling region.
      assertTrue(caches.get(1).getRegionManager().getAllRegions(Region.Type.MARSHALLING).contains(region1));

      // now deactivate the region on cache 1.
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

   }

   protected void createAndActivateRegion(CacheSPI<Object, Object> c, Fqn f)
   {
      Region r = c.getRegion(f, true);
      r.registerContextClassLoader(getClass().getClassLoader());
      r.activate();
   }

   /**
    * Provides a hook for multiplexer integration. This default implementation
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      FooClassLoader loader = new FooClassLoader(originalClassLoaderTL.get());

      if (useRegionBased)
      {
         Region r = cache.getRegion(Fqn.ROOT, true);
         r.registerContextClassLoader(loader);
         r.activate();
      }

      Class clazz = loader.loadFoo();
      Object obj = clazz.newInstance();
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      URLClassLoader ucl1 = createOrphanClassLoader();
      Thread.currentThread().setContextClassLoader(ucl1);

      Region region = cache.getRegion(fqn("/"), true);
      region.registerContextClassLoader(Thread.currentThread().getContextClassLoader());
      region.activate();

      Class clazz1 = ucl1.loadClass(INSTANCE_CLASS_NAME);
      cache.put(fqn("/a"), "key", clazz1.newInstance());
View Full Code Here

Examples of org.jboss.cache.Region.registerContextClassLoader()

      region.deactivate();
      region.unregisterContextClassLoader();

      Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());

      region.registerContextClassLoader(Thread.currentThread().getContextClassLoader());

      try
      {
         Global object = (Global) cache.get(fqn("/a"), "key");
         assertNull(object);
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.