vertx.eventBus()
.registerHandler(addressBase + ".getMetaData", new Handler<Message<JsonObject>>() {
@Override
public void handle(final Message<JsonObject> requestEvent) {
final GetWorkspaceMetaDataResponseImpl metaData =
GetWorkspaceMetaDataResponseImpl.make()
.setRunTarget(runTarget).setWorkspaceName(webRoot);
if (lastOpenedFileId != null) {
// Resolve file to a path.
vertx.eventBus().send("tree.getCurrentPaths", new JsonObject().putArray(
"resourceIds", new JsonArray().addString(lastOpenedFileId)),
new Handler<Message<JsonObject>>() {
@Override
public void handle(Message<JsonObject> event) {
List<String> openFiles = new ArrayList<String>();
openFiles.add((String) event.body.getArray("paths").toArray()[0]);
metaData.setLastOpenFiles(openFiles);
requestEvent.reply(Dto.wrap(metaData));
}
});
}
}