-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJobContext.java
More file actions
23 lines (18 loc) · 868 Bytes
/
JobContext.java
File metadata and controls
23 lines (18 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package dev.arcp.runtime.agent;
import dev.arcp.core.events.EventBody;
import dev.arcp.core.error.BudgetExhaustedException;
import dev.arcp.core.error.LeaseExpiredException;
import dev.arcp.core.error.PermissionDeniedException;
/** Per-job runtime handle passed to {@link Agent#run}. */
public interface JobContext {
/** Emit a job event for this job. Thread-safe; ordering preserved per job. */
void emit(EventBody body);
/** {@code true} if a {@code job.cancel} or session close has been observed. */
boolean cancelled();
/**
* Authorize an operation against the active lease (§9.3 / §9.5 / §9.6).
* Throws on lease subset violation, expired lease, or exhausted budget.
*/
void authorize(String namespace, String pattern)
throws PermissionDeniedException, LeaseExpiredException, BudgetExhaustedException;
}