| 541 | |
| 542 | std::string description() const override { return name; } |
| 543 | bool init(FDBWorkloadContext* context) override { |
| 544 | this->context = context; |
| 545 | try { |
| 546 | std::string classPath = context->getOption("classPath", std::string("")); |
| 547 | std::vector<std::string> paths; |
| 548 | boost::split(paths, classPath, boost::is_any_of(";,"), boost::token_compress_on); |
| 549 | for (const auto& path : paths) { |
| 550 | jvm->addToClassPath(path); |
| 551 | } |
| 552 | jvm->init(); |
| 553 | jobject jContext = jvm->createWorkloadContext(context); |
| 554 | if (jContext == nullptr) { |
| 555 | failed = true; |
| 556 | return failed; |
| 557 | } |
| 558 | workload = jvm->createWorkload(jContext, name); |
| 559 | } catch (JNIError& e) { |
| 560 | failed = true; |
| 561 | log.trace(error, "JNIError", { { "Location", e.location() }, { "Error", e.toString() } }); |
| 562 | } |
| 563 | return failed; |
| 564 | }; |
| 565 | void setup(FDBDatabase* db, GenericPromise<bool> done) override { |
| 566 | if (failed) { |
| 567 | done.send(false); |
nothing calls this directly
no test coverage detected