use of com.canoo.dp.impl.remoting.commands.DestroyControllerCommand in project dolphin-platform by canoo.
the class DestroyControllerCommandEncoder method decode.
@Override
public DestroyControllerCommand decode(final JsonObject jsonObject) {
Assert.requireNonNull(jsonObject, "jsonObject");
try {
final DestroyControllerCommand command = new DestroyControllerCommand();
command.setControllerId(getStringElement(jsonObject, CONTROLLER_ID));
return command;
} catch (final Exception ex) {
throw new JsonParseException("Illegal JSON detected", ex);
}
}
use of com.canoo.dp.impl.remoting.commands.DestroyControllerCommand in project dolphin-platform by canoo.
the class ControllerProxyImpl method destroy.
@Override
public CompletableFuture<Void> destroy() {
if (destroyed) {
throw new IllegalStateException("The controller was already destroyed");
}
destroyed = true;
final InternalAttributesBean bean = platformBeanRepository.getInternalAttributesBean();
final CompletableFuture<Void> ret = new CompletableFuture<>();
final DestroyControllerCommand destroyControllerCommand = new DestroyControllerCommand();
destroyControllerCommand.setControllerId(controllerId);
clientConnector.send(destroyControllerCommand, () -> {
model = null;
ret.complete(null);
});
return ret;
}
Aggregations