Upgrade to Spring Data Kay
Dependency updates supporting Kay: Upgrade Spring Framework to 5.0.0.M3 Upgrade Spring Boot to 1.5.0.RC1 Upgrade Jackson to 2.7.6 Upgrade Jedis to 2.9.0 Upgrade Lettuce to 5.0.0.Beta1 Upgrade Mockito to 2.5.4 Fixes #gh-677
This commit is contained in:
@@ -17,14 +17,15 @@ dependencies {
|
||||
|
||||
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
|
||||
|
||||
runtime "org.springframework.shell:spring-shell:1.0.0.RELEASE"
|
||||
runtime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
|
||||
|
||||
testCompile "junit:junit:$junitVersion",
|
||||
"org.assertj:assertj-core:$assertjVersion"
|
||||
"org.assertj:assertj-core:$assertjVersion",
|
||||
"org.projectlombok:lombok:$lombokVersion"
|
||||
|
||||
integrationTestCompile seleniumDependencies
|
||||
|
||||
integrationTestRuntime "org.springframework.shell:spring-shell:1.0.0.RELEASE"
|
||||
integrationTestRuntime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
|
||||
}
|
||||
|
||||
mainClassName = 'sample.Application'
|
||||
|
||||
@@ -19,10 +19,10 @@ package sample;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.gemstone.gemfire.cache.client.Pool;
|
||||
import com.gemstone.gemfire.management.membership.ClientMembership;
|
||||
import com.gemstone.gemfire.management.membership.ClientMembershipEvent;
|
||||
import com.gemstone.gemfire.management.membership.ClientMembershipListenerAdapter;
|
||||
import org.apache.geode.cache.Region;
|
||||
import org.apache.geode.management.membership.ClientMembership;
|
||||
import org.apache.geode.management.membership.ClientMembershipEvent;
|
||||
import org.apache.geode.management.membership.ClientMembershipListenerAdapter;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -31,9 +31,9 @@ import org.springframework.util.Assert;
|
||||
|
||||
public class GemFireCacheServerReadyBeanPostProcessor implements BeanPostProcessor {
|
||||
|
||||
static final long DEFAULT_WAIT_DURATION = TimeUnit.SECONDS.toMillis(20);
|
||||
static final long DEFAULT_TIMEOUT = TimeUnit.SECONDS.toMillis(60);
|
||||
|
||||
static final CountDownLatch latch = new CountDownLatch(1);
|
||||
static final CountDownLatch LATCH = new CountDownLatch(1);
|
||||
|
||||
@Value("${spring.session.data.gemfire.port:${application.gemfire.client-server.port}}")
|
||||
int port;
|
||||
@@ -42,27 +42,21 @@ public class GemFireCacheServerReadyBeanPostProcessor implements BeanPostProcess
|
||||
String host;
|
||||
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
if ("gemfirePool".equals(beanName)) {
|
||||
if ("gemfireCache".equals(beanName)) {
|
||||
ClientMembership.registerClientMembershipListener(
|
||||
new ClientMembershipListenerAdapter() {
|
||||
@Override
|
||||
public void memberJoined(ClientMembershipEvent event) {
|
||||
latch.countDown();
|
||||
LATCH.countDown();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return bean;
|
||||
}
|
||||
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName)
|
||||
throws BeansException {
|
||||
|
||||
if (bean instanceof Pool && "gemfirePool".equals(beanName)) {
|
||||
else if (bean instanceof Region) {
|
||||
try {
|
||||
Assert.state(latch.await(DEFAULT_WAIT_DURATION, TimeUnit.MILLISECONDS),
|
||||
String.format("GemFire Cache Server failed to start on host [%1$s] and port [%2$d]",
|
||||
this.host, this.port));
|
||||
boolean didNotTimeout = LATCH.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
|
||||
|
||||
Assert.state(didNotTimeout, String.format(
|
||||
"GemFire Cache Server failed to start on host [%s] and port [%d]", this.host, this.port));
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
@@ -71,5 +65,9 @@ public class GemFireCacheServerReadyBeanPostProcessor implements BeanPostProcess
|
||||
|
||||
return bean;
|
||||
}
|
||||
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
// tag::end[]
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<!--6-->
|
||||
<gfe:pool keep-alive="false"
|
||||
ping-interval="5000"
|
||||
read-timeout="5000"
|
||||
read-timeout="15000"
|
||||
retry-attempts="1"
|
||||
subscription-enabled="true"
|
||||
thread-local-connections="false">
|
||||
|
||||
Reference in New Issue
Block a user