Skip to content

Commit

Permalink
Revert "Update Raft tests to use primitive client/service APIs."
Browse files Browse the repository at this point in the history
This reverts commit ce78bae.
  • Loading branch information
kuujo committed May 3, 2018
1 parent ce78bae commit e5f3f6d
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 257 deletions.
Expand Up @@ -330,12 +330,8 @@ protected void acceptAll(Consumer<C> event) {
@SuppressWarnings("unchecked")
public final void register(PrimitiveSession session) {
SessionProxyHandler sessionProxyHandler = new SessionProxyHandler(session);
if (clientInterface != null) {
C sessionProxy = (C) java.lang.reflect.Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{clientInterface}, sessionProxyHandler);
sessions.put(session.sessionId(), new SessionProxy(session, sessionProxy));
} else {
sessions.put(session.sessionId(), new SessionProxy(session, null));
}
C sessionProxy = (C) java.lang.reflect.Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{clientInterface}, sessionProxyHandler);
sessions.put(session.sessionId(), new SessionProxy(session, sessionProxy));
onOpen(session);
}

Expand Down Expand Up @@ -451,7 +447,7 @@ private final class SessionProxyHandler implements InvocationHandler {

private SessionProxyHandler(PrimitiveSession session) {
this.session = session;
this.events = clientInterface != null ? Events.getMethodMap(clientInterface) : Maps.newHashMap();
this.events = Events.getMethodMap(clientInterface);
}

@Override
Expand Down

0 comments on commit e5f3f6d

Please sign in to comment.