|
1 | 1 | package dev.dbos.transact; |
2 | 2 |
|
| 3 | +import dev.dbos.transact.conductor.Conductor; |
3 | 4 | import dev.dbos.transact.config.DBOSConfig; |
4 | 5 | import dev.dbos.transact.database.SystemDatabase; |
5 | 6 | import dev.dbos.transact.execution.DBOSExecutor; |
@@ -38,6 +39,7 @@ public class DBOS { |
38 | 39 | private final QueueService queueService; |
39 | 40 | private final SchedulerService schedulerService; |
40 | 41 | private NotificationService notificationService; |
| 42 | + private Conductor conductor; |
41 | 43 | private HttpServer httpServer; |
42 | 44 | private RecoveryService recoveryService; |
43 | 45 |
|
@@ -222,6 +224,12 @@ public void launch() { |
222 | 224 | notificationService.start(); |
223 | 225 | } |
224 | 226 |
|
| 227 | + String conductorKey = config.getConductorKey(); |
| 228 | + if (conductorKey != null) { |
| 229 | + conductor = new Conductor.Builder(systemDatabase, dbosExecutor, conductorKey).build(); |
| 230 | + conductor.start(); |
| 231 | + } |
| 232 | + |
225 | 233 | if (config.isHttp()) { |
226 | 234 | httpServer = HttpServer.getInstance(config.getHttpPort(), |
227 | 235 | new AdminController(systemDatabase, dbosExecutor)); |
@@ -263,6 +271,10 @@ public void shutdown() { |
263 | 271 | notificationService.stop(); |
264 | 272 | } |
265 | 273 |
|
| 274 | + if (conductor != null) { |
| 275 | + conductor.stop(); |
| 276 | + } |
| 277 | + |
266 | 278 | if (config.isHttp()) { |
267 | 279 | httpServer.stop(); |
268 | 280 | } |
|
0 commit comments