Package org.infinispan.container

Examples of org.infinispan.container.InternalEntryFactoryImpl


         }
      };
      when(mockCache.getAdvancedCache().getComponentRegistry().getComponent(any(Class.class))).then(answer);
      when(mockCache.getAdvancedCache().getComponentRegistry().getComponent(any(Class.class), anyString())).then(answer);
      n.injectDependencies(mockCache, new ClusteringDependentLogic.LocalLogic(), null, config,
                           mock(DistributionManager.class), retriever, new InternalEntryFactoryImpl());
      n.start();
      ctx = new NonTxInvocationContext(AnyEquivalence.getInstance());
   }
View Full Code Here


         AdvancedCache<Object, Object> cache = cm.getCache().getAdvancedCache();

         DataContainer ddc = DefaultDataContainer.unBoundedDataContainer(cache.getCacheConfiguration().locking().concurrencyLevel());
         ActivationManager activationManager = mock(ActivationManager.class);
         doNothing().when(activationManager).onUpdate(Mockito.anyObject(), Mockito.anyBoolean());
         ((DefaultDataContainer) ddc).initialize(null, null,new InternalEntryFactoryImpl(), activationManager, null, TIME_SERVICE);
         QueryableDataContainer.setDelegate(ddc);

         // Verify that the default is correctly established
         Assert.assertEquals(cm.getDefaultCacheConfiguration().dataContainer().dataContainer().getClass().getName(), QueryableDataContainer.class.getName());
View Full Code Here

         AdvancedCache<Object, Object> cache = cm.getCache().getAdvancedCache();

         DataContainer ddc = DefaultDataContainer.unBoundedDataContainer(cache.getCacheConfiguration().locking().concurrencyLevel());
         ActivationManager activationManager = mock(ActivationManager.class);
         doNothing().when(activationManager).onUpdate(Mockito.anyObject(), Mockito.anyBoolean());
         ((DefaultDataContainer) ddc).initialize(null, null,new InternalEntryFactoryImpl(), activationManager, null, TIME_SERVICE);
         QueryableDataContainer.setDelegate(ddc);

         // Verify that the config is correct
         Assert.assertEquals(cm.getDefaultCacheConfiguration().dataContainer().dataContainer().getClass(), QueryableDataContainer.class);
View Full Code Here

   //alwaysRun = true otherwise, when we run unstable tests, this method is not invoked (because it belongs to the unit group)
   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception {
      marshaller = new TestObjectStreamMarshaller();
      timeService = new ControlledTimeService(0);
      factory = new InternalEntryFactoryImpl();
      ((InternalEntryFactoryImpl) factory).injectTimeService(timeService);
      try {
         //noinspection unchecked
         cl = createStore();
         cl.start();
View Full Code Here

      TestingUtil.replaceField(remoteExecutorService, "remoteCommandsExecutor",
                               extractGlobalComponent(cacheManager, InboundInvocationHandler.class),
                               InboundInvocationHandlerImpl.class);

      GetKeyValueCommand getKeyValueCommand =
            new GetKeyValueCommand("key", InfinispanCollections.<Flag>emptySet(), false, new InternalEntryFactoryImpl());
      PutKeyValueCommand putKeyValueCommand =
            new PutKeyValueCommand("key", "value", false, null,
                                   new EmbeddedMetadata.Builder().build(), InfinispanCollections.<Flag>emptySet(), AnyEquivalence.getInstance());

      //populate commands
      blockingCacheRpcCommand = new ReduceCommand<Object, Object>(cacheName);
      nonBlockingCacheRpcCommand = new ClusteredGetCommand(cacheName);
      blockingNonCacheRpcCommand = new CacheTopologyControlCommand();
      //the GetKeyValueCommand is not replicated, but I only need a command that returns false in canBlock()
      nonBlockingNonCacheRpcCommand = new GetKeyValueCommand("key", InfinispanCollections.<Flag>emptySet(), false, new InternalEntryFactoryImpl());
      blockingSingleRpcCommand = new SingleRpcCommand(cacheName, putKeyValueCommand);
      nonBlockingSingleRpcCommand = new SingleRpcCommand(cacheName, getKeyValueCommand);
      blockingMultipleRpcCommand = new MultipleRpcCommand(Arrays.<ReplicableCommand>asList(putKeyValueCommand, putKeyValueCommand), cacheName);
      blockingMultipleRpcCommand2 = new MultipleRpcCommand(Arrays.<ReplicableCommand>asList(putKeyValueCommand, getKeyValueCommand), cacheName);
      nonBlockingMultipleRpcCommand = new MultipleRpcCommand(Arrays.<ReplicableCommand>asList(getKeyValueCommand, getKeyValueCommand), cacheName);
View Full Code Here

         }
      };
      when(mockCache.getAdvancedCache().getComponentRegistry().getComponent(any(Class.class))).then(answer);
      when(mockCache.getAdvancedCache().getComponentRegistry().getComponent(any(Class.class), anyString())).then(answer);
      n.injectDependencies(mockCache, new ClusteringDependentLogic.LocalLogic(), null, config,
                           mock(DistributionManager.class), retriever, new InternalEntryFactoryImpl());
      n.start();
      ctx = new NonTxInvocationContext(AnyEquivalence.getInstance());
   }
View Full Code Here

      CacheNotifierImpl notifier = new CacheNotifierImpl();
      Cache mockCache = mock(Cache.class, RETURNS_DEEP_STUBS);
      Configuration config = mock(Configuration.class, RETURNS_DEEP_STUBS);
      when(config.clustering().cacheMode()).thenReturn(CacheMode.LOCAL);
      notifier.injectDependencies(mockCache, new ClusteringDependentLogic.LocalLogic(), null, config,
                           mock(DistributionManager.class), mock(EntryRetriever.class), new InternalEntryFactoryImpl());
      return notifier;
   }
View Full Code Here

            Collections.<Flag>emptySet(), false, null, AnyEquivalence.getInstance());
      marshallAndAssertEquality(c2);

      // SizeCommand does not have an empty constructor, so doesn't look to be one that is marshallable.

      GetKeyValueCommand c4 = new GetKeyValueCommand("key", Collections.<Flag>emptySet(), false, new InternalEntryFactoryImpl());
      byte[] bytes = marshaller.objectToByteBuffer(c4);
      GetKeyValueCommand rc4 = (GetKeyValueCommand) marshaller.objectFromByteBuffer(bytes);
      assert rc4.getCommandId() == c4.getCommandId() : "Writen[" + c4.getCommandId() + "] and read[" + rc4.getCommandId() + "] objects should be the same";
      assert Arrays.equals(rc4.getParameters(), c4.getParameters()) : "Writen[" + c4.getParameters() + "] and read[" + rc4.getParameters() + "] objects should be the same";
View Full Code Here

      storeConfigurationBuilder.connectionPool().maxTotalConnections(10).maxConnectionsPerHost(10);
      storeConfigurationBuilder.validate();
      RestStore restStore = new RestStore();
      restStore.init(new DummyInitializationContext(storeConfigurationBuilder.create(), getCache(), getMarshaller(),
                                                    new ByteBufferFactoryImpl(), new MarshalledEntryFactoryImpl(getMarshaller())));
      InternalEntryFactoryImpl iceFactory = new InternalEntryFactoryImpl();
      iceFactory.injectTimeService(TIME_SERVICE);
      restStore.setInternalCacheEntryFactory(iceFactory);
      restStore.start();
      return restStore;
   }
View Full Code Here

         if (useVersioning)
            return (T) new IncrementalVersionableEntryFactoryImpl();
         else
            return (T) new EntryFactoryImpl();
      } else {
         return (T) new InternalEntryFactoryImpl();
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.container.InternalEntryFactoryImpl

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.