org.infinispan.client.hotrod.RemoteCacheManager.isStarted()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(11.5k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中org.infinispan.client.hotrod.RemoteCacheManager.isStarted方法的一些代码示例,展示了RemoteCacheManager.isStarted的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteCacheManager.isStarted方法的具体详情如下:
包路径:org.infinispan.client.hotrod.RemoteCacheManager
类名称:RemoteCacheManager
方法名:isStarted

RemoteCacheManager.isStarted介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

@Override
public boolean isStarted() {
  return this.remoteCacheManager.isStarted();
}

代码示例来源:origin: org.wildfly/wildfly-clustering-infinispan-extension

@Override
public boolean isStarted() {
  return this.remoteCacheManager.isStarted();
}

代码示例来源:origin: kiegroup/appformer

@Override
public void dispose() {
  if (this.cacheManager.isStarted()) {
    this.cacheManager.stop();
  }
}

代码示例来源:origin: org.uberfire/uberfire-metadata-backend-infinispan

@Override
public void dispose() {
  if (this.cacheManager.isStarted()) {
    this.cacheManager.stop();
  }
}

代码示例来源:origin: apache/marmotta

/**
   * Shutdown this cache manager instance. Will shutdown the underlying EHCache cache manager.
   */
  @Override
  public void shutdown() {
    try {
      log.info("shutting down Infinispan remote cache manager ...");
      cacheManager.stop();

      while(cacheManager.isStarted()) {
        log.info("waiting 100ms for cache manager to come down ...");
        Thread.sleep(100);
      }
    } catch (CacheException | InterruptedException ex) {
      log.warn("error shutting down cache: {}", ex.getMessage());
    }
  }
}

代码示例来源:origin: org.infinispan.server/infinispan-server-testsuite

@Test
public void testStartStop() {
  Configuration cfg = createRemoteCacheManagerConfigurationBuilder().build();
  RemoteCacheManager rcm = new RemoteCacheManager(cfg, false);
  // check initial status
  assertTrue("RemoteCacheManager should not be started initially", !rcm.isStarted());
  // check start status
  rcm.start();
  assertTrue("RemoteCacheManager should be started after calling start()", rcm.isStarted());
  // check stopped status
  rcm.stop();
  assertTrue("RemoteCacheManager should be stopped after calling stop()", !rcm.isStarted());
}

代码示例来源:origin: org.infinispan/infinispan-spring4

/**
* Test method for {@link org.infinispan.spring.provider.SpringRemoteCacheManager#stop()}.
*
* @throws IOException
*/
@Test
public final void stopShouldStopTheNativeRemoteCacheManager() throws IOException {
 final RemoteCacheManager nativeCacheManager = new RemoteCacheManager(true);
 final SpringRemoteCacheManager objectUnderTest = new SpringRemoteCacheManager(
    nativeCacheManager);
 objectUnderTest.stop();
 assertFalse("Calling stop() on SpringRemoteCacheManager should stop the enclosed "
          + "Infinispan RemoteCacheManager. However, it is still running.",
       nativeCacheManager.isStarted());
}

代码示例来源:origin: org.infinispan/infinispan-spring5-remote

/**
* Test method for {@link org.infinispan.spring.provider.SpringRemoteCacheManager#start()}.
*
* @throws IOException
*/
@Test
public final void startShouldStartTheNativeRemoteCacheManager() throws IOException {
 final RemoteCacheManager nativeCacheManager = new RemoteCacheManager(true);
 final SpringRemoteCacheManager objectUnderTest = new SpringRemoteCacheManager(
    nativeCacheManager);
 objectUnderTest.start();
 assertTrue("Calling start() on SpringRemoteCacheManager should start the enclosed "
          + "Infinispan RemoteCacheManager. However, it is still not running.",
       nativeCacheManager.isStarted());
}

代码示例来源:origin: org.infinispan/infinispan-spring4

/**
* Test method for {@link org.infinispan.spring.provider.SpringRemoteCacheManager#start()}.
*
* @throws IOException
*/
@Test
public final void startShouldStartTheNativeRemoteCacheManager() throws IOException {
 final RemoteCacheManager nativeCacheManager = new RemoteCacheManager(true);
 final SpringRemoteCacheManager objectUnderTest = new SpringRemoteCacheManager(
    nativeCacheManager);
 objectUnderTest.start();
 assertTrue("Calling start() on SpringRemoteCacheManager should start the enclosed "
          + "Infinispan RemoteCacheManager. However, it is still not running.",
       nativeCacheManager.isStarted());
}

代码示例来源:origin: org.infinispan/infinispan-spring5-remote

/**
* Test method for {@link org.infinispan.spring.provider.SpringRemoteCacheManager#stop()}.
*
* @throws IOException
*/
@Test
public final void stopShouldStopTheNativeRemoteCacheManager() throws IOException {
 final RemoteCacheManager nativeCacheManager = new RemoteCacheManager(true);
 final SpringRemoteCacheManager objectUnderTest = new SpringRemoteCacheManager(
    nativeCacheManager);
 objectUnderTest.stop();
 assertFalse("Calling stop() on SpringRemoteCacheManager should stop the enclosed "
          + "Infinispan RemoteCacheManager. However, it is still running.",
       nativeCacheManager.isStarted());
}

代码示例来源:origin: org.infinispan.server/infinispan-server-testsuite

@Test
public void testDefaultConstructor() throws Exception {
  Configuration conf = createRemoteCacheManagerConfigurationBuilder().build();
  // use the properties file hotrod-client.properties on classpath
  // this properties file contains the test properties with server_list set to ${node0.address}:11222;${node1.address}:11222
  RemoteCacheManager rcm = new RemoteCacheManager();
  RemoteCacheManager rcm2 = new RemoteCacheManager(false);
  assertTrue(rcm.isStarted());
  assertFalse(rcm2.isStarted());
  RemoteCache rc = rcm.getCache(testCache);
  assertEqualConfiguration(conf, rc);
}

代码示例来源:origin: org.infinispan.server/infinispan-server-testsuite

@Test
public void testConfigurationConstructors() throws Exception {
  Configuration conf = createRemoteCacheManagerConfigurationBuilder().build();
  RemoteCacheManager rcm = new RemoteCacheManager(conf);
  RemoteCacheManager rcm2 = new RemoteCacheManager(conf, false);
  assertTrue(rcm.isStarted());
  assertFalse(rcm2.isStarted());
  RemoteCache rc = rcm.getCache(testCache);
  assertEqualConfiguration(conf, rc);
}

代码示例来源:origin: org.infinispan/infinispan-spring5-remote

/**
* Test method for
* {@link org.infinispan.spring.remote.support.InfinispanRemoteCacheManagerFactoryBean#destroy()}
* .
*
* @throws Exception
*/
@Test
public final void destroyShouldStopTheProducedCache() throws Exception {
 final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
 objectUnderTest.afterPropertiesSet();
 final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();
 objectUnderTest.destroy();
 assertFalse(
    "destroy() should have stopped the RemoteCacheManager instance previously produced by "
       + "AbstractRemoteCacheManagerFactory. However, the produced RemoteCacheManager is still running. ",
    remoteCacheManager.isStarted());
}

代码示例来源:origin: org.infinispan/infinispan-spring4

/**
* Test method for
* {@link org.infinispan.spring.support.remote.InfinispanRemoteCacheManagerFactoryBean#destroy()}
* .
*
* @throws Exception
*/
@Test
public final void destroyShouldStopTheProducedCache() throws Exception {
 final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
 objectUnderTest.afterPropertiesSet();
 final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();
 objectUnderTest.destroy();
 assertFalse(
    "destroy() should have stopped the RemoteCacheManager instance previously produced by "
       + "AbstractRemoteCacheManagerFactory. However, the produced RemoteCacheManager is still running. ",
    remoteCacheManager.isStarted());
}

代码示例来源:origin: org.infinispan.server/infinispan-server-testsuite

@Before
public void initialize() {
 if (remoteCacheManager == null || !remoteCacheManager.isStarted()) {
   Configuration config = createRemoteCacheManagerConfiguration();
   remoteCacheManager = new RemoteCacheManager(config, true);
 }
 scriptCache = remoteCacheManager.getCache(SCRIPT_CACHE_NAME);
 remoteCache = remoteCacheManager.getCache();
}

代码示例来源:origin: org.infinispan/infinispan-spring5-remote

/**
* Test method for
* {@link org.infinispan.spring.provider.SpringRemoteCacheManagerFactoryBean#destroy()}.
*
* @throws Exception
*/
@Test
public final void destroyShouldStopTheProducedCache() throws Exception {
 final SpringRemoteCacheManagerFactoryBean objectUnderTest = new SpringRemoteCacheManagerFactoryBean();
 objectUnderTest.afterPropertiesSet();
 final SpringRemoteCacheManager remoteCacheManager = objectUnderTest.getObject();
 objectUnderTest.destroy();
 assertFalse(
    "destroy() should have stopped the SpringRemoteCacheManager instance previously produced by "
       + "SpringRemoteCacheManagerFactoryBean. However, the produced SpringRemoteCacheManager is still running. ",
    remoteCacheManager.getNativeCacheManager().isStarted());
}

代码示例来源:origin: org.infinispan/infinispan-spring4

/**
* Test method for
* {@link org.infinispan.spring.provider.SpringRemoteCacheManagerFactoryBean#destroy()}.
*
* @throws Exception
*/
@Test
public final void destroyShouldStopTheProducedCache() throws Exception {
 final SpringRemoteCacheManagerFactoryBean objectUnderTest = new SpringRemoteCacheManagerFactoryBean();
 objectUnderTest.afterPropertiesSet();
 final SpringRemoteCacheManager remoteCacheManager = objectUnderTest.getObject();
 objectUnderTest.destroy();
 assertFalse(
    "destroy() should have stopped the SpringRemoteCacheManager instance previously produced by "
       + "SpringRemoteCacheManagerFactoryBean. However, the produced SpringRemoteCacheManager is still running. ",
    remoteCacheManager.getNativeCacheManager().isStarted());
}

代码示例来源:origin: org.infinispan/infinispan-spring5-remote

/**
* Test method for
* {@link org.infinispan.spring.remote.support.InfinispanRemoteCacheManagerFactoryBean#setStartAutomatically(boolean)}
* .
*
* @throws Exception
*/
@Test
public final void shouldProduceAStoppedCacheIfStartAutomaticallyIsSetToFalse() throws Exception {
 final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
 objectUnderTest.setStartAutomatically(false);
 objectUnderTest.afterPropertiesSet();
 final RemoteCacheManager remoteCacheManagerExpectedToBeInStateStopped = objectUnderTest
    .getObject();
 assertFalse(
    "AbstractRemoteCacheManagerFactory should have produced a RemoteCacheManager that is initially in state stopped "
       + "since property 'startAutomatically' has been set to false. However, the produced RemoteCacheManager is already started.",
    remoteCacheManagerExpectedToBeInStateStopped.isStarted());
 objectUnderTest.destroy();
}

代码示例来源:origin: org.infinispan/infinispan-spring4

/**
* Test method for
* {@link org.infinispan.spring.support.remote.InfinispanRemoteCacheManagerFactoryBean#setStartAutomatically(boolean)}
* .
*
* @throws Exception
*/
@Test
public final void shouldProduceAStoppedCacheIfStartAutomaticallyIsSetToFalse() throws Exception {
 final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
 objectUnderTest.setStartAutomatically(false);
 objectUnderTest.afterPropertiesSet();
 final RemoteCacheManager remoteCacheManagerExpectedToBeInStateStopped = objectUnderTest
    .getObject();
 assertFalse(
    "AbstractRemoteCacheManagerFactory should have produced a RemoteCacheManager that is initially in state stopped "
       + "since property 'startAutomatically' has been set to false. However, the produced RemoteCacheManager is already started.",
    remoteCacheManagerExpectedToBeInStateStopped.isStarted());
 objectUnderTest.destroy();
}

代码示例来源:origin: org.infinispan/infinispan-spring5-remote

/**
* Test method for
* {@link org.infinispan.spring.provider.SpringRemoteCacheManagerFactoryBean#setStartAutomatically(boolean)}
* .
*
* @throws Exception
*/
@Test
public final void shouldProduceAStoppedCacheIfStartAutomaticallyIsSetToFalse() throws Exception {
 final SpringRemoteCacheManagerFactoryBean objectUnderTest = new SpringRemoteCacheManagerFactoryBean();
 objectUnderTest.setStartAutomatically(false);
 objectUnderTest.afterPropertiesSet();
 final SpringRemoteCacheManager remoteCacheManagerExpectedToBeInStateStopped = objectUnderTest
    .getObject();
 assertFalse(
    "SpringRemoteCacheManagerFactoryBean should have produced a SpringRemoteCacheManager that is initially in state stopped "
       + "since property 'startAutomatically' has been set to false. However, the produced SpringRemoteCacheManager is already started.",
    remoteCacheManagerExpectedToBeInStateStopped.getNativeCacheManager().isStarted());
 objectUnderTest.destroy();
}

相关文章