Stdlib index
- Captured-borrow migration worklist (3.3.3)
- Owned-bind migration worklist (8.2.7)
- Return-side title audit — the ride-through enumeration
- stdlib ownership audit
- stdlib ownership dispositions (plan 1.3.1 / 4.3.1)
aot
codec
codec / csv
codec / json
collection
- ArrayList
- BPlusTree
- Cache
- Collectors
- HashMap
- HashSet
- Heap
- ImmutableList
- ImmutableMap
- ImmutableSet
- LinkedList
- RedBlackTree
- Sort
collection / ltm
concurrent
error
- Exception
- NoOptionalValueException
- NotProvidedException
- RecoverableException
- ScopedBuildFailedException
- ScopeNotActiveException
- Throwable
- UnrecoverableException
gfx
hash
ifx
io
io / file
io / net
io / net / dns
io / net / uri
lang
lang / stream
math
math / fft
math / linalg
math / npio
math / poly
math / random
math / stats
nucleo
- Columns — the Arrow-laid-out substrate
- Fused tensor expressions — Fuse
- Table — the lazy, typed dataframe
- Tape — define-by-run autograd
- Transform intrinsics — Grad, Vmap, Jit
process
reflect
search / distance
search / fuzzy
search / ngram
session
time
- Clock
- DateTimeFormatter
- Duration
- Instant
- LocalDate
- LocalDateTime
- LocalTime
- Period
- ZonedDateTime
- ZoneId
- ZoneOffset
wire
xpu
xpu / mesh
Scoped
cajeta.aot.Scoped<T> is a handle on a scoped component, injected where the
holder outlives the component’s scope. A field may hold only a component that
outlives its holder, so a singleton that needs a request’s component injects
the handle and resolves it where it is needed.
import cajeta.aot.Scoped;
@Component(scope = "Order")
public class Budget {
public int32 left;
public Budget() { this.left = 10; return; }
}
@Component
public class Spender {
@Inject Scoped<Budget> budget;
public Spender() { return; }
public int32 spend(int32 n) {
Budget b = this.budget.get();
b.left = b.left - n;
return b.left;
}
}
public final class Calls {
@Scope("Order")
public static int32 once(int32 n) {
Spender s = Spender.__cajeta_inject();
return s.spend(n);
}
}
Methods
| Signature | |
|---|---|
T get() | The component in the scope active now, borrowed from its scope |
get() outside every activation of the scope throws
ScopeNotActiveException. The holder
owns the handle, and the handle owns nothing.