SGF-63
+ improved schema
+ fix some bugs that prevented the client cache to reuse an already defined pool
This commit is contained in:
Costin Leau
2011-08-26 20:46:38 +03:00
parent abb10bc303
commit ed0ca63c55
8 changed files with 44 additions and 32 deletions

View File

@@ -20,6 +20,9 @@ import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Properties;
import org.springframework.data.gemfire.ForkUtil;
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheFactory;
@@ -57,7 +60,8 @@ public class CacheServerProcess {
server.setNotifyBySubscription(true);
server.start();
ForkUtil.createControlFile(CacheServerProcess.class.getName());
System.out.println("Waiting for signal");
// wait for signal
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

View File

@@ -24,15 +24,12 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.data.gemfire.CacheFactoryBean;
import org.springframework.data.gemfire.ForkUtil;
import org.springframework.data.gemfire.listener.adapter.ContinousQueryListenerAdapter;
import com.gemstone.gemfire.cache.RegionService;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.client.PoolFactory;
import com.gemstone.gemfire.cache.client.PoolManager;
import com.gemstone.gemfire.cache.query.CqEvent;
/**
@@ -63,18 +60,10 @@ public class ListenerContainerTests {
props.put("name", "cq-client");
props.put("log-level", "warning");
CacheFactoryBean cacheFB = new CacheFactoryBean();
cacheFB.setBeanName("gemfire-cache");
cacheFB.setUseBeanFactoryLocator(false);
cacheFB.setProperties(props);
cacheFB.afterPropertiesSet();
ClientCacheFactory ccf = new ClientCacheFactory(props);
ccf.setPoolSubscriptionEnabled(true);
cache = ccf.create();
cache = cacheFB.getObject();
PoolFactory pf = PoolManager.createFactory();
pf.addServer("localhost", 40404);
pf.setSubscriptionEnabled(true);
pool = pf.create("client");
}
@@ -99,8 +88,6 @@ public class ListenerContainerTests {
String query = "SELECT * from /test-cq";
container = new ContinousQueryListenerContainer();
//container.setQueryService(pool.getQueryService());
System.out.println(cache instanceof ClientCache);
container.setCache(cache);
container.setBeanName("container");
container.addListener(new ContinousQueryDefinition("test", query, adapter));

View File

@@ -26,7 +26,6 @@ import org.springframework.data.gemfire.ForkUtil;
import org.springframework.data.gemfire.listener.ContinousQueryListenerContainer;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.client.PoolFactory;
import com.gemstone.gemfire.cache.client.PoolManager;
import com.gemstone.gemfire.cache.query.CqQuery;
@@ -52,11 +51,6 @@ public class ContainerXmlSetupTest {
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
"/org/springframework/data/gemfire/listener/container.xml");
PoolFactory pf = PoolManager.createFactory();
pf.addServer("localhost", 40404);
pf.setSubscriptionEnabled(true);
Pool pool = pf.create("client");
ContinousQueryListenerContainer container = ctx.getBean(ContinousQueryListenerContainer.class);
assertTrue(container.isRunning());