当前位置: 首页>>代码示例>>Java>>正文


Java Cache.addBridgeServer方法代码示例

本文整理汇总了Java中com.gemstone.gemfire.cache.Cache.addBridgeServer方法的典型用法代码示例。如果您正苦于以下问题:Java Cache.addBridgeServer方法的具体用法?Java Cache.addBridgeServer怎么用?Java Cache.addBridgeServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.gemstone.gemfire.cache.Cache的用法示例。


在下文中一共展示了Cache.addBridgeServer方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addBridgeServerInVM

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
protected int addBridgeServerInVM(VM vm, final String[] groups) {
  SerializableCallable connect =
    new SerializableCallable("Add Bridge server") {

    public Object call() throws Exception {
      Cache cache = (Cache) remoteObjects.get(CACHE_KEY);
      BridgeServer server = cache.addBridgeServer();
      final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
      server.setPort(serverPort);
      server.setGroups(groups);
      server.start();
      return new Integer(serverPort);
    }
  };
  Integer port = (Integer) vm.invoke(connect);
  return port.intValue();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:18,代码来源:LocatorTestBase.java

示例2: startBridgeServer

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
/**
 * Starts a bridge server on the given port
 *
 * @since 4.0
 */
public int startBridgeServer(int port)
  throws IOException {

  Cache cache = getCache();
  BridgeServer bridge = cache.addBridgeServer();
  bridge.setPort(port);
  bridge.setMaxThreads(getMaxThreads());
  bridge.start();
  return bridge.getPort();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:16,代码来源:BridgeTestCase.java

示例3: createServerCache

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
public static Integer createServerCache(Boolean notifyBySubscription, Integer maxThreads)
throws Exception {
  Cache cache = new BridgeWriterMiscDUnitTest("temp").createCacheV(new Properties());
  unsetSlowDispatcherFlag();
  AttributesFactory factory = new AttributesFactory();
  factory.setScope(Scope.DISTRIBUTED_ACK);
  factory.setEnableConflation(true);
  factory.setDataPolicy(DataPolicy.REPLICATE);
  RegionAttributes myAttrs = factory.create();
  Region r1 = cache.createRegion(REGION_NAME1, myAttrs);
  Region r2 = cache.createRegion(REGION_NAME2, myAttrs);
  factory = new AttributesFactory();
  factory.setDataPolicy(DataPolicy.PARTITION);
  RegionAttributes prAttrs = factory.create();
  Region pr = cache.createRegion(PR_REGION_NAME, prAttrs);
  assertNotNull(r1);
  assertNotNull(r2);
  assertNotNull(pr);

  BridgeServer server = cache.addBridgeServer();
  int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
  r1.getCache().getDistributedSystem().getLogWriter().info("Starting server on port " + port);
  server.setPort(port);
  server.setMaxThreads(maxThreads.intValue());
  server.setNotifyBySubscription(notifyBySubscription.booleanValue());
  server.start();
  r1.getCache().getDistributedSystem().getLogWriter().info("Started server on port " + server.getPort());
  return new Integer(server.getPort());

}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:31,代码来源:BridgeWriterMiscDUnitTest.java

示例4: createBridgeServer

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
protected void createBridgeServer(int port) {
  Cache c = getCache();
  BridgeServer bridge = c.addBridgeServer();
  bridge.setNotifyBySubscription(true);
  bridge.setPort(port);
  try {
    bridge.start();
  } catch (IOException ioe) {
    fail("Could not start BridgeServer on port " + port);
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:12,代码来源:LondonToNewYorkDUnitTest.java

示例5: startBridgeServer

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
/**
 * Starts a bridge server on the given port, using the given
 * deserializeValues and notifyBySubscription to serve up the
 * given region.
 */
protected void startBridgeServer(int port, boolean notifyBySubscription)
throws IOException {

  Cache cache = getCache();
  BridgeServer bridge = cache.addBridgeServer();
  bridge.setPort(port);
  bridge.setNotifyBySubscription(notifyBySubscription);
  bridge.start();
  bridgeServerPort = bridge.getPort();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:16,代码来源:QueryMonitorDUnitTest.java

示例6: startBridgeServer

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
/**
 * Starts a bridge server on the given port, using the given
 * deserializeValues and notifyBySubscription to serve up the
 * given region.
 *
 * @since 6.6
 */
public void startBridgeServer(int port, boolean notifyBySubscription)
throws IOException {
  
  Cache cache = getCache();
  BridgeServer bridge = cache.addBridgeServer();
  bridge.setPort(port);
  bridge.setNotifyBySubscription(notifyBySubscription);
  bridge.start();
  bridgeServerPort = bridge.getPort();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:18,代码来源:QueryIndexUpdateRIDUnitTest.java

示例7: startCacheServer

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
/**
 * Starts a bridge server on the given port, using the given
 * deserializeValues and notifyBySubscription to serve up the
 * given region.
 */
protected void startCacheServer(int port, boolean notifyBySubscription)
throws IOException {

  Cache cache = CacheFactory.getAnyInstance();
  BridgeServer bridge = cache.addBridgeServer();
  bridge.setPort(port);
  bridge.setNotifyBySubscription(notifyBySubscription);
  bridge.start();
  bridgeServerPort = bridge.getPort();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:16,代码来源:PdxQueryDUnitTest.java

示例8: startBridgeServer

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
/**
 * Starts a bridge server on the given port, using the given
 * deserializeValues and notifyBySubscription to serve up the
 * given region.
 *
 * @since 5.5
 */
protected void startBridgeServer(int port, boolean notifyBySubscription)
throws IOException {
  
  Cache cache = getCache();
  BridgeServer bridge = cache.addBridgeServer();
  bridge.setPort(port);
  bridge.setNotifyBySubscription(notifyBySubscription);
  bridge.start();
  bridgeServerPort = bridge.getPort();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:18,代码来源:PrCqUsingPoolDUnitTest.java

示例9: startBridgeServer

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
/**
 * Starts a bridge server on the given port, using the given
 * deserializeValues and notifyBySubscription to serve up the
 * given region.
 *
 * @since 4.0
 */
public void startBridgeServer(int port, boolean notifyBySubscription)
throws IOException {
  
  Cache cache = getCache();
  BridgeServer bridge = cache.addBridgeServer();
  bridge.setPort(port);
  bridge.setNotifyBySubscription(notifyBySubscription);
  bridge.start();
  bridgeServerPort = bridge.getPort();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:18,代码来源:CqQueryUsingPoolDUnitTest.java

示例10: startBridgeServerInVM

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
protected int startBridgeServerInVM(final VM vm, final String[] groups,
    String locators, final String[] regions) {
  SerializableCallable connect =
    new SerializableCallable("Start bridge server") {
        public Object call() throws IOException  {
          Properties props = new Properties();
          props.setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(mCastPort));
          props.setProperty(DistributionConfig.MCAST_ADDRESS_NAME, DistributionConfig.DEFAULT_MCAST_ADDRESS.getHostAddress());
          props.setProperty(DistributionConfig.LOCATORS_NAME, "");
          props.setProperty(DistributionConfig.BIND_ADDRESS_NAME,
              getServerHostName(vm.getHost()));
          DistributedSystem ds = getSystem(props);
          Cache cache = CacheFactory.create(ds);
          AttributesFactory factory = new AttributesFactory();
          factory.setScope(Scope.DISTRIBUTED_ACK);
          factory.setEnableBridgeConflation(true);
          factory.setDataPolicy(DataPolicy.REPLICATE);
          RegionAttributes attrs = factory.create();
          for(int i = 0; i < regions.length; i++) {
            cache.createRegion(regions[i], attrs);
          }
          BridgeServer server = cache.addBridgeServer();
          final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
          server.setPort(serverPort);
          server.setGroups(groups);
          server.start();
          
          remoteObjects.put(CACHE_KEY, cache);
          
          return new Integer(serverPort);
        }
      };
  Integer port = (Integer) vm.invoke(connect);
  return port.intValue();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:36,代码来源:AutoConnectionSourceWithUDPDUnitTest.java

示例11: startBridgeServerInVM

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
protected int startBridgeServerInVM(VM vm, final String[] groups, final String locators, final String[] regions, final ServerLoadProbe probe) {
  SerializableCallable connect =
    new SerializableCallable("Start bridge server") {
        public Object call() throws IOException  {
          Properties props = new Properties();
          props.setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(0));
          props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
          DistributedSystem ds = getSystem(props);
          Cache cache = CacheFactory.create(ds);
          AttributesFactory factory = new AttributesFactory();
          factory.setScope(Scope.DISTRIBUTED_ACK);
          factory.setEnableBridgeConflation(true);
          factory.setDataPolicy(DataPolicy.REPLICATE);
          RegionAttributes attrs = factory.create();
          for(int i = 0; i < regions.length; i++) {
            cache.createRegion(regions[i], attrs);
          }
          BridgeServer server = cache.addBridgeServer();
          final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
          server.setPort(serverPort);
          server.setGroups(groups);
          server.setLoadProbe(probe);
          server.start();
          
          remoteObjects.put(CACHE_KEY, cache);
          
          return new Integer(serverPort);
        }
      };
  Integer port = (Integer) vm.invoke(connect);
  return port.intValue();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:33,代码来源:LocatorTestBase.java

示例12: startBridgeServerWithEmbeddedLocator

import com.gemstone.gemfire.cache.Cache; //导入方法依赖的package包/类
protected int startBridgeServerWithEmbeddedLocator(VM vm, final String[] groups, final String locators, final String[] regions, final ServerLoadProbe probe) {
  SerializableCallable connect =
    new SerializableCallable("Start bridge server") {
        public Object call() throws IOException  {
          Properties props = new Properties();
          props.setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(0));
          props.setProperty(DistributionConfig.START_LOCATOR_NAME, locators);
          props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
          DistributedSystem ds = getSystem(props);
          Cache cache = CacheFactory.create(ds);
          AttributesFactory factory = new AttributesFactory();
          factory.setScope(Scope.DISTRIBUTED_ACK);
          factory.setEnableBridgeConflation(true);
          factory.setDataPolicy(DataPolicy.REPLICATE);
          RegionAttributes attrs = factory.create();
          for(int i = 0; i < regions.length; i++) {
            cache.createRegion(regions[i], attrs);
          }
          BridgeServer server = cache.addBridgeServer();
          server.setGroups(groups);
          server.setLoadProbe(probe);
          final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
          server.setPort(serverPort);
          server.start();
          
          remoteObjects.put(CACHE_KEY, cache);
          
          return new Integer(serverPort);
        }
      };
  Integer port = (Integer) vm.invoke(connect);
  return port.intValue();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:34,代码来源:LocatorTestBase.java


注:本文中的com.gemstone.gemfire.cache.Cache.addBridgeServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。