Examples of ComponentRegistry


Examples of org.jboss.cache.factories.ComponentRegistry

      // Put the cache in the map before starting, so if it fails in
      // start it can still be destroyed later
      caches.put("secretive", cache);

      // inject our own message listener and re-wire deps
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
//      cr.unregisterComponent(ChannelMessageListener.class);
      cr.registerComponent(new SecretiveStateCacheMessageListener(), ChannelMessageListener.class);
//      cr.updateDependencies();

      cache.start();


      c= UnitTestConfigurationFactory.createConfiguration(CacheMode.REPL_ASYNC);
      //c.setClusterName("VersionedTestBase");
      c.setReplVersionString(getReplicationVersion());
      // Use a long timeout to facilitate setting debugger breakpoints
      c.setStateRetrievalTimeout(60000);
      CacheSPI recipient = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());

      //Put the cache in the map before starting, so if it fails in
      // start it can still be destroyed later
      caches.put("secretive2", recipient);

      // inject our own message listener and re-wire deps
      cr = TestingUtil.extractComponentRegistry(recipient);
      cr.registerComponent(new SecretiveStateCacheMessageListener(), ChannelMessageListener.class);

      try
      {
         recipient.start();
         fail("start() should throw an exception");
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

      try
      {
         Configuration cfg = UnitTestConfigurationFactory.createConfiguration(CacheMode.LOCAL, true);
         cfg.getEvictionConfig().setWakeupInterval(0);
         c = new UnitTestCacheFactory<String, String>().createCache(cfg, getClass());
         ComponentRegistry cr = TestingUtil.extractComponentRegistry(c);
         RegionManager rm = cr.getComponent(RegionManager.class);
         EvictionTimerTask ett = rm.getEvictionTimerTask();
         assert ett.scheduledExecutor == null;
      }
      finally
      {
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

      try
      {
         Configuration cfg = UnitTestConfigurationFactory.createConfiguration(CacheMode.LOCAL, true);
         cfg.getEvictionConfig().setWakeupInterval(10);
         c = new UnitTestCacheFactory<String, String>().createCache(cfg, getClass());
         ComponentRegistry cr = TestingUtil.extractComponentRegistry(c);
         RegionManager rm = cr.getComponent(RegionManager.class);
         EvictionTimerTask ett = rm.getEvictionTimerTask();
         assert ett.scheduledExecutor != null;
      }
      finally
      {
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

    * Bootstraps this factory with a Configuration and a ComponentRegistry.
    */
   private void bootstrap(CacheSPI spi, Configuration configuration)
   {
      // injection bootstrap stuff
      componentRegistry = new ComponentRegistry(configuration, spi);
      componentRegistry.registerDefaultClassLoader(defaultClassLoader);
      this.configuration = configuration;

      componentRegistry.registerComponent(spi, CacheSPI.class);
      componentRegistry.registerComponent(new PlatformMBeanServerRegistration(), PlatformMBeanServerRegistration.class);
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

   public void setUp() throws Exception
   {
      listener = new TestListener();
      cache = createCacheWithListener(listener);

      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);

      CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
      cr.registerComponent(interceptor, OptimisticCreateIfNotExistsInterceptor.class);
      CommandInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
      cr.registerComponent(nodeInterceptor, OptimisticNodeInterceptor.class);
      dummy = new MockInterceptor();
      cr.registerComponent(dummy, MockInterceptor.class);

      interceptor.setNext(nodeInterceptor);
      nodeInterceptor.setNext(dummy);

      TestingUtil.replaceInterceptorChain(cache, interceptor);
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

   @AfterMethod
   public void postTest()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);

      LockAssert.assertNoLocks(cr.getComponent(LockManager.class), cr.getComponent(InvocationContextContainer.class));
   }
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

   @AfterMethod
   public void postTest()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);

      LockAssert.assertNoLocks(cr.getComponent(LockManager.class), cr.getComponent(InvocationContextContainer.class));
   }
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

      cache = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(false);
      c = cache.getConfiguration();
      c.setUseRegionBasedMarshalling(true);
      c.setFetchInMemoryState(false);
      cache.start();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      crTL.set(cr);
      rman = TestingUtil.extractComponentRegistry(cache).getComponent(RegionManager.class);
   }
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

   }

   public void testOOBFlag() throws Exception
   {
      DelegatingRPCManager delegatingRPCManager = new DelegatingRPCManager();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(c1);
      RPCManager origRpcManager = cr.getComponent(RPCManager.class);
      delegatingRPCManager.delegate = origRpcManager;
      cr.registerComponent(delegatingRPCManager, RPCManager.class);
      cr.rewire();

      c1.getTransactionManager().begin();
      c1.put("/a", "k", "v");
      c1.getTransactionManager().commit();
View Full Code Here

Examples of org.jboss.cache.factories.ComponentRegistry

    * Make sure the 2 caches have different component instances
    */
   public void testSeparateNotifiersAndListeners()
   {
      assert cache1 != cache2;
      ComponentRegistry cr1, cr2;
      cr1 = TestingUtil.extractComponentRegistry(cache1);
      cr2 = TestingUtil.extractComponentRegistry(cache2);
      assert cr1 != cr2;
      assert cr1.getComponent(Notifier.class) != cr2.getComponent(Notifier.class);
      assert eventLog1 != eventLog2;
      assert cache1.getLocalAddress() != cache2.getLocalAddress();
      CacheSPI spi1, spi2;
      spi1 = (CacheSPI) cache1;
      spi2 = (CacheSPI) cache2;
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.