use of org.apache.geode.cache.server.CacheServer in project geode by apache.
the class PRClientServerTestBase method startServerHA.
public static void startServerHA() throws Exception {
WaitCriterion wc = new WaitCriterion() {
String excuse;
public boolean done() {
return false;
}
public String description() {
return excuse;
}
};
Wait.waitForCriterion(wc, 2000, 500, false);
Collection bridgeServers = cache.getCacheServers();
LogWriterUtils.getLogWriter().info("Start Server Bridge Servers list : " + bridgeServers.size());
Iterator bridgeIterator = bridgeServers.iterator();
CacheServer bridgeServer = (CacheServer) bridgeIterator.next();
LogWriterUtils.getLogWriter().info("start Server Bridge Server" + bridgeServer);
bridgeServer.start();
}
use of org.apache.geode.cache.server.CacheServer in project geode by apache.
the class PRClientServerTestBase method createCacheServerWithDR.
public static Integer createCacheServerWithDR() throws Exception {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(DataPolicy.REPLICATE);
assertNotNull(cache);
Region region = cache.createRegion(regionName, factory.create());
assertNotNull(region);
CacheServer server1 = cache.addCacheServer();
assertNotNull(server1);
int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
server1.setPort(port);
server1.start();
assertTrue(server1.isRunning());
return new Integer(server1.getPort());
}
use of org.apache.geode.cache.server.CacheServer in project geode by apache.
the class PRClientServerTestBase method createCacheServer.
public static Integer createCacheServer() throws Exception {
CacheServer server1 = cache.addCacheServer();
assertNotNull(server1);
int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
server1.setPort(port);
server1.start();
assertTrue(server1.isRunning());
return new Integer(server1.getPort());
}
use of org.apache.geode.cache.server.CacheServer in project geode by apache.
the class HAGIIDUnitTest method createServer2Cache.
public static void createServer2Cache(Integer port) throws Exception {
new HAGIIDUnitTest().createCache(new Properties());
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(DataPolicy.REPLICATE);
RegionAttributes attrs = factory.create();
cache.createRegion(REGION_NAME, attrs);
CacheServer server1 = cache.addCacheServer();
server1.setPort(port.intValue());
server1.setNotifyBySubscription(true);
server1.start();
}
use of org.apache.geode.cache.server.CacheServer in project geode by apache.
the class HAGIIDUnitTest method createServer1Cache.
public static Integer createServer1Cache() throws Exception {
new HAGIIDUnitTest().createCache(new Properties());
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(DataPolicy.REPLICATE);
RegionAttributes attrs = factory.create();
cache.createRegion(REGION_NAME, attrs);
int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
CacheServer server1 = cache.addCacheServer();
server1.setPort(port);
server1.setNotifyBySubscription(true);
server1.start();
return new Integer(server1.getPort());
}
Aggregations