| 59 | namespace minifi { |
| 60 | |
| 61 | FlowController::FlowController(std::shared_ptr<core::Repository> provenance_repo, std::shared_ptr<core::Repository> flow_file_repo, |
| 62 | std::shared_ptr<Configure> configure, std::unique_ptr<core::FlowConfiguration> flow_configuration, |
| 63 | std::shared_ptr<core::ContentRepository> content_repo, const std::string /*name*/, bool headless_mode, |
| 64 | std::shared_ptr<utils::file::FileSystem> filesystem) |
| 65 | : core::controller::ForwardingControllerServiceProvider(core::getClassName<FlowController>()), |
| 66 | c2::C2Client(std::move(configure), std::move(provenance_repo), std::move(flow_file_repo), |
| 67 | std::move(content_repo), std::move(flow_configuration), std::move(filesystem)), |
| 68 | running_(false), |
| 69 | updating_(false), |
| 70 | initialized_(false), |
| 71 | thread_pool_(2, false, nullptr, "Flowcontroller threadpool"), |
| 72 | logger_(logging::LoggerFactory<FlowController>::getLogger()) { |
| 73 | if (provenance_repo_ == nullptr) |
| 74 | throw std::runtime_error("Provenance Repo should not be null"); |
| 75 | if (flow_file_repo_ == nullptr) |
| 76 | throw std::runtime_error("Flow Repo should not be null"); |
| 77 | if (configuration_ == nullptr) { |
| 78 | throw std::runtime_error("Must supply a configuration."); |
| 79 | } |
| 80 | running_ = false; |
| 81 | initialized_ = false; |
| 82 | |
| 83 | protocol_ = utils::make_unique<FlowControlProtocol>(this, configuration_); |
| 84 | |
| 85 | if (!headless_mode) { |
| 86 | initializeExternalComponents(); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | void FlowController::initializeExternalComponents() { |
| 91 | auto jvmCreator = core::ClassLoader::getDefaultClassLoader().instantiate("JVMCreator", "JVMCreator"); |
nothing calls this directly
no outgoing calls
no test coverage detected