remove unused getVatIdFactory()
This commit is contained in:
parent
5e797d36a3
commit
68edac583b
4 changed files with 4 additions and 24 deletions
|
@ -15,7 +15,7 @@ public class RpcSystem<VatId extends StructReader> {
|
|||
private final Map<VatNetwork.Connection<VatId>, RpcState<VatId>> connections = new ConcurrentHashMap<>();
|
||||
|
||||
public RpcSystem(VatNetwork<VatId> network) {
|
||||
this(network, (BootstrapFactory)null);
|
||||
this(network, (BootstrapFactory<VatId>)null);
|
||||
}
|
||||
|
||||
public RpcSystem(VatNetwork<VatId> network,
|
||||
|
@ -26,12 +26,6 @@ public class RpcSystem<VatId extends StructReader> {
|
|||
public RpcSystem(VatNetwork<VatId> network,
|
||||
Capability.Client bootstrapInterface) {
|
||||
this(network, new BootstrapFactory<VatId>() {
|
||||
|
||||
@Override
|
||||
public FromPointerReader<VatId> getVatIdFactory() {
|
||||
return this.getVatIdFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Capability.Client createFor(VatId clientId) {
|
||||
return bootstrapInterface;
|
||||
|
@ -47,7 +41,7 @@ public class RpcSystem<VatId extends StructReader> {
|
|||
}
|
||||
|
||||
public Capability.Client bootstrap(VatId vatId) {
|
||||
var connection = this.getNetwork().connect(vatId);
|
||||
var connection = this.network.connect(vatId);
|
||||
if (connection != null) {
|
||||
var state = getConnectionState(connection);
|
||||
var hook = state.restore();
|
||||
|
@ -66,15 +60,14 @@ public class RpcSystem<VatId extends StructReader> {
|
|||
}
|
||||
|
||||
RpcState<VatId> getConnectionState(VatNetwork.Connection<VatId> connection) {
|
||||
var state = this.connections.computeIfAbsent(connection, conn -> {
|
||||
return this.connections.computeIfAbsent(connection, conn -> {
|
||||
var onDisconnect = new CompletableFuture<RpcState.DisconnectInfo>();
|
||||
onDisconnect.thenCompose(info -> {
|
||||
this.connections.remove(connection);
|
||||
return info.shutdownPromise.thenRun(() -> connection.close());
|
||||
return info.shutdownPromise.thenRun(connection::close);
|
||||
});
|
||||
return new RpcState<>(this.bootstrapFactory, conn, onDisconnect);
|
||||
});
|
||||
return state;
|
||||
}
|
||||
|
||||
public void accept(VatNetwork.Connection<VatId> connection) {
|
||||
|
|
|
@ -83,11 +83,6 @@ public class RpcStateTest {
|
|||
this.connection = new TestConnection();
|
||||
this.bootstrapInterface = new Capability.Client(Capability.newNullCap());
|
||||
var bootstrapFactory = new BootstrapFactory<RpcTwoPartyProtocol.VatId.Reader>() {
|
||||
@Override
|
||||
public FromPointerReader<RpcTwoPartyProtocol.VatId.Reader> getVatIdFactory() {
|
||||
return RpcTwoPartyProtocol.VatId.factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Capability.Client createFor(RpcTwoPartyProtocol.VatId.Reader clientId) {
|
||||
return bootstrapInterface;
|
||||
|
|
|
@ -281,11 +281,6 @@ public class RpcTest {
|
|||
}
|
||||
|
||||
static BootstrapFactory<Test.TestSturdyRef.Reader> bootstrapFactory = new BootstrapFactory<>() {
|
||||
@Override
|
||||
public FromPointerReader<Test.TestSturdyRef.Reader> getVatIdFactory() {
|
||||
return Test.TestSturdyRef.factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Capability.Client createFor(Test.TestSturdyRef.Reader refId) {
|
||||
var callCount = new Counter();
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package org.capnproto;
|
||||
|
||||
public interface BootstrapFactory<VatId> {
|
||||
|
||||
FromPointerReader<VatId> getVatIdFactory();
|
||||
|
||||
Capability.Client createFor(VatId clientId);
|
||||
}
|
Loading…
Reference in a new issue