List of usage examples for org.springframework.integration.gemfire.fork ForkUtil createControlFile
public static boolean createControlFile(String name) throws IOException
From source file:org.springframework.integration.gemfire.fork.CacheServerProcess.java
public static void main(String[] args) throws Exception { Properties props = new Properties(); props.setProperty("name", "CacheServer at " + new Date()); props.setProperty("log-level", "info"); logger.info("Connecting to the distributed system and creating the cache."); Cache cache = new CacheFactory(props).create(); // Create region. Region<?, ?> region = cache.createRegionFactory(RegionShortcut.REPLICATE).setScope(Scope.DISTRIBUTED_ACK) .create("test"); logger.info("Test region, " + region.getFullPath() + ", created in cache."); // Start Cache Server. CacheServer server = cache.addCacheServer(); server.setPort(40404);//from w w w.j ava 2 s .com logger.info("Starting server"); server.start(); ForkUtil.createControlFile(CacheServerProcess.class.getName()); logger.info("Waiting for shutdown"); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); bufferedReader.readLine(); }