Merge pull request from michaelcameron/configurable-child-classes

Separate client construction into separate method
pull/1124/head
Nikita Koksharov committed by GitHub
commit 006e1e7934

@ -162,6 +162,12 @@ public class RedissonSessionManager extends ManagerBase implements Lifecycle {
@Override
public void start() throws LifecycleException {
redisson = buildClient();
lifecycle.fireLifecycleEvent(START_EVENT, null);
}
protected RedissonClient buildClient() throws LifecycleException {
Config config = null;
try {
config = Config.fromJSON(new File(configPath), getClass().getClassLoader());
@ -176,12 +182,10 @@ public class RedissonSessionManager extends ManagerBase implements Lifecycle {
}
try {
redisson = Redisson.create(config);
return Redisson.create(config);
} catch (Exception e) {
throw new LifecycleException(e);
}
lifecycle.fireLifecycleEvent(START_EVENT, null);
}
@Override

@ -143,6 +143,13 @@ public class RedissonSessionManager extends ManagerBase {
@Override
protected void startInternal() throws LifecycleException {
super.startInternal();
redisson = buildClient();
setState(LifecycleState.STARTING);
}
protected RedissonClient buildClient() throws LifecycleException {
Config config = null;
try {
config = Config.fromJSON(new File(configPath), getClass().getClassLoader());
@ -166,12 +173,10 @@ public class RedissonSessionManager extends ManagerBase {
throw new IllegalStateException("Unable to initialize codec with ClassLoader parameter", e);
}
redisson = Redisson.create(config);
return Redisson.create(config);
} catch (Exception e) {
throw new LifecycleException(e);
}
setState(LifecycleState.STARTING);
}
@Override

@ -144,6 +144,12 @@ public class RedissonSessionManager extends ManagerBase {
@Override
protected void startInternal() throws LifecycleException {
super.startInternal();
redisson = buildClient();
setState(LifecycleState.STARTING);
}
protected RedissonClient buildClient() throws LifecycleException {
Config config = null;
try {
config = Config.fromJSON(new File(configPath), getClass().getClassLoader());
@ -163,12 +169,10 @@ public class RedissonSessionManager extends ManagerBase {
.newInstance(Thread.currentThread().getContextClassLoader());
config.setCodec(codec);
redisson = Redisson.create(config);
return Redisson.create(config);
} catch (Exception e) {
throw new LifecycleException(e);
}
setState(LifecycleState.STARTING);
}
@Override

Loading…
Cancel
Save