Examples of ClientCache


Examples of com.gemstone.gemfire.cache.client.ClientCache

    // TODO reference to an internal GemFire class!
    if (cache instanceof GemFireCacheImpl) {
      Assert.isTrue(((GemFireCacheImpl) cache).isClient(), "A client-cache instance is required.");
    }

    ClientCache clientCache = (ClientCache) cache;

    ClientRegionFactory<K, V> factory = clientCache.createClientRegionFactory(resolveClientRegionShortcut());

    // map region attributes onto the client region factory
    if (attributes != null) {
      factory.setCloningEnabled(attributes.getCloningEnabled());
      factory.setCompressor(attributes.getCompressor());
View Full Code Here

Examples of com.gemstone.gemfire.cache.client.ClientCache

  /**
   * Inform the GemFire cluster that this client cache is ready to receive events.
   */
  private void readyForEvents(){
    ClientCache clientCache = ClientCacheFactory.getAnyInstance();

    if (Boolean.TRUE.equals(readyForEvents) && !clientCache.isClosed()) {
      try {
        clientCache.readyForEvents();
      }
      catch (IllegalStateException ignore) {
        // cannot be called for a non-durable client so exception is thrown
      }
    }
View Full Code Here

Examples of com.gemstone.gemfire.cache.client.ClientCache

  }

  @Test
  @SuppressWarnings("unchecked")
  public void testLookupQueryService() {
    ClientCache mockClientCache = mock(ClientCache.class, "testLookupQueryService.ClientCache");
    QueryService mockQueryService = mock(QueryService.class, "testLookupQueryService.QueryService");
    Region<Object, Object> mockRegion = mock(Region.class, "testLookupQueryService.Region");

    when(mockRegion.getRegionService()).thenReturn(mockClientCache);
    when(mockClientCache.getQueryService()).thenReturn(mockQueryService);

    GemfireTemplate localTemplate = new GemfireTemplate(mockRegion) {
      @Override boolean isLocalWithNoServerProxy(final Region<?, ?> region) {
        return false;
      }
View Full Code Here

Examples of com.gemstone.gemfire.cache.client.ClientCache

  }

  @Test
  @SuppressWarnings("unchecked")
  public void testLookupLocalQueryService() {
    ClientCache mockClientCache = mock(ClientCache.class, "testLookupLocalQueryService.ClientCache");
    QueryService mockQueryService = mock(QueryService.class, "testLookupLocalQueryService.QueryService");
    Region<Object, Object> mockRegion = mock(Region.class, "testLookupLocalQueryService.Region");
    RegionAttributes<Object, Object> mockRegionAttributes = mock(RegionAttributes.class, "testLookupLocalQueryService.RegionAttributes");

    when(mockClientCache.getLocalQueryService()).thenReturn(mockQueryService);
    when(mockRegion.getRegionService()).thenReturn(mockClientCache);
    when(mockRegion.getAttributes()).thenReturn(mockRegionAttributes);
    when(mockRegionAttributes.getScope()).thenReturn(Scope.LOCAL);

    GemfireTemplate localTemplate = new GemfireTemplate(mockRegion) {
View Full Code Here

Examples of com.gemstone.gemfire.cache.client.ClientCache

  ApplicationContext context;

  @Test
  public void testContextCreated() throws Exception {

    ClientCache cache = context.getBean("gemfireCache", ClientCache.class);
    Pool pool = context.getBean("gemfirePool", Pool.class);
    assertEquals("gemfirePool", pool.getName());
    assertEquals(1, cache.getDefaultPool().getServers().size());
    assertEquals(pool.getServers().get(0), cache.getDefaultPool().getServers().get(0));

    context.getBean("r1", Region.class);

    GemfireOnServerFunctionTemplate template = context.getBean(GemfireOnServerFunctionTemplate.class);
    assertTrue(template.getResultCollector() instanceof MyResultCollector);
View Full Code Here

Examples of com.gemstone.gemfire.cache.client.ClientCache

    when(beanFactory.getBean(Pool.class)).thenReturn(pool);

    factoryBean.setBeanFactory(beanFactory);

    ClientCache cache = mock(ClientCache.class);
    ClientRegionFactory<Object, Object> clientRegionFactory = mock(ClientRegionFactory.class);
    Region<Object, Object> expectedRegion = mock(Region.class);

    when(cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)).thenReturn(clientRegionFactory);
    when(clientRegionFactory.create("testRegion")).thenReturn(expectedRegion);

    Region<Object, Object> actualRegion = factoryBean.lookupFallback(cache, "testRegion");

    assertSame(expectedRegion, actualRegion);
View Full Code Here

Examples of com.vaadin.server.LegacyCommunicationManager.ClientCache

            new ResourceWriter().write(ui, writer, paintTarget);

            Collection<Class<? extends ClientConnector>> usedClientConnectors = paintTarget
                    .getUsedClientConnectors();
            boolean typeMappingsOpen = false;
            ClientCache clientCache = manager.getClientCache(ui);

            List<Class<? extends ClientConnector>> newConnectorTypes = new ArrayList<Class<? extends ClientConnector>>();

            for (Class<? extends ClientConnector> class1 : usedClientConnectors) {
                if (clientCache.cache(class1)) {
                    // client does not know the mapping key for this type, send
                    // mapping to client
                    newConnectorTypes.add(class1);

                    if (!typeMappingsOpen) {
View Full Code Here

Examples of com.vaadin.server.LegacyCommunicationManager.ClientCache

            new ResourceWriter().write(ui, writer, paintTarget);

            Collection<Class<? extends ClientConnector>> usedClientConnectors = paintTarget
                    .getUsedClientConnectors();
            boolean typeMappingsOpen = false;
            ClientCache clientCache = manager.getClientCache(ui);

            List<Class<? extends ClientConnector>> newConnectorTypes = new ArrayList<Class<? extends ClientConnector>>();

            for (Class<? extends ClientConnector> class1 : usedClientConnectors) {
                if (clientCache.cache(class1)) {
                    // client does not know the mapping key for this type, send
                    // mapping to client
                    newConnectorTypes.add(class1);

                    if (!typeMappingsOpen) {
View Full Code Here

Examples of org.apache.hadoop.mapred.ClientCache

  @Before
  public void setUp() throws Exception {
    resourceMgrDelegate = mock(ResourceMgrDelegate.class);
    conf = new YarnConfiguration();
    clientCache = new ClientCache(conf, resourceMgrDelegate);
    clientCache = spy(clientCache);
    yarnRunner = new YARNRunner(conf, resourceMgrDelegate, clientCache);
    yarnRunner = spy(yarnRunner);
    submissionContext = mock(ApplicationSubmissionContext.class);
    doAnswer(
View Full Code Here

Examples of org.apache.hadoop.mapred.ClientCache

  @Before
  public void setUp() throws Exception {
    resourceMgrDelegate = mock(ResourceMgrDelegate.class);
    conf = new YarnConfiguration();
    clientCache = new ClientCache(conf, resourceMgrDelegate);
    clientCache = spy(clientCache);
    yarnRunner = new YARNRunner(conf, resourceMgrDelegate, clientCache);
    yarnRunner = spy(yarnRunner);
    submissionContext = mock(ApplicationSubmissionContext.class);
    doAnswer(
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.