ASTRA API Reference Guide
This reference covers the ASTRA-facing modules in astra-apis. The Agenda, Beliefs and System sections describe ASTRA 2.8.10; the other sections retain their previously documented contracts. It lists actions, terms, formulae and events exposed by module annotations; Java helper classes and internal sensor callbacks are not callable APIs. Separate adapters are covered in Environments, LLM Integration and MAMS.
Using a module
Declare a module inside an agent:
agent Example {
module Console console;
module Strings strings;
plan +!main(list args) {
console.readString(string Name);
if (strings.startsWith(Name, "A")) {
console.println("Hello, " + Name);
}
}
}
Each declaration creates an instance associated with that agent. The identifier, such as console, is chosen by you. Classes in astra.lang can use short names; other classes require an import or a fully qualified declaration, such as module astra.util.DB db;.
Kind |
Use |
Example |
|---|---|---|
Action |
Statement; failure fails the calling intention |
|
Term |
Expression returning a typed value |
|
Formula |
Guard, condition, query or wait |
|
Event |
Trigger for a plan |
|
Action implementations return Java booleans for success or failure; you do not assign these booleans in ASTRA. An output parameter is shown as out T name: pass a typed unbound variable, for example console.readInt(int N);. Term results are shown in the result column. Formulae participate in reasoning, rather than being boolean term expressions. Java object types retain their class names and may require imports.
Indices are zero-based. Typed readers generally cast values instead of converting them, so the stored type must match. Actions that return failure can be handled using Failure Handling; methods that log errors or return null have their own limitations described below.
Module directory
Module |
Purpose |
|---|---|
Named delayed and periodic achievement goals |
|
Adopt and retract beliefs represented as function terms |
|
Console input and output |
|
Beliefs, events, intention stacks and explanations |
|
Inspect function terms |
|
Predicate/function conversion and boolean formulae |
|
Numeric parsing, extrema and random integers |
|
Configure message transports |
|
Access Java objects through reflection |
|
Lists and Java collection conversion |
|
Legacy placeholder |
|
String tests, splitting and replacement |
|
Agent lifecycle and runtime management |
|
Dynamic subgoals and callable metadata |
|
What an agent remembers of a previous life (weak recovery) |
|
Periodic events |
|
Agent logging |
|
Runtime parsing and rule construction |
|
Inspect execution explanations |
|
JDBC database access |
|
Shared named key/value spaces |
|
Legacy logging wrapper |
Core modules
astra.lang.Agenda
Schedules independent top-level achievement goals from function terms. Times are milliseconds: after accepts zero or a positive delay; every requires a positive interval, waits one interval before the first firing and uses fixed-rate scheduling. Names must be nonblank and are local to the owning agent. Scheduling an existing name replaces its future firings. Cancellation succeeds even for an absent name; cancellation and replacement do not withdraw goals already adopted.
Periodic firings are skipped, not queued for later, while a matching achievement goal is queued or running. Matching uses the goal’s predicate name and argument values, not the schedule name, so another schedule or a separately posted matching goal can suppress a firing. Agenda also tracks its own in-flight goal by identity if its arguments are mutated. This is not a lock on all goals with the same name: different arguments can run concurrently, and one-shot schedules do not perform this busy check.
Goal arguments must be ground scalar values (string, int, long, float, double, boolean, char), lists or nested function terms containing only those values. Variables, formulas and arbitrary Java objects are not supported; excessive nesting is rejected. Agenda copies the template when scheduling and copies it again for each firing, so modifying a list in one invocation does not alter later invocations. Agent termination cancels its schedules. This is runtime cleanup, not disk persistence or restart recovery.
module Agenda agenda;
module Console console;
types scheduledWork { formula scan(string); }
plan +!main(list args) {
agenda.after("initial", 0, scan("hall"));
agenda.every("periodic", 60000, scan("hall"));
}
plan +!scan(string Room) {
console.println("scan " + Room);
}
plan +!stopScanning() {
if (agenda.scheduled("periodic")) {
agenda.cancel("periodic");
}
}
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Adopt a goal once after a non-negative delay; replace this agent’s same-named schedule. |
Action |
|
Periodically adopt a goal; skip while a matching goal is queued or running. |
Action |
|
Cancel future firings; already adopted goals continue. |
Formula |
|
True while this agent has a schedule waiting for future firings; a one-shot entry is removed when it fires. |
astra.lang.Beliefs
Adopts and retracts ordinary beliefs represented as funct values. The function’s name and arguments become the belief predicate’s name and arguments. These actions do not update environment observations or operate a device. For fixed predicates, ordinary +belief(...); and -belief(...); statements remain the simpler choice.
module Beliefs beliefs;
types workState { formula pending(string); }
plan +!main(list args) {
funct Fact = pending("hall");
beliefs.adoptBelief(Fact);
beliefs.adoptBeliefs([pending("kitchen"), pending("office")]);
beliefs.retractBelief(Fact);
beliefs.retractBeliefs([pending("kitchen"), pending("office")]);
}
Every entry in a bulk list must be a function term, not a string containing source text or a nested list. The implementation processes entries sequentially and casts each entry to Funct. There is no transaction or rollback: an invalid later entry can fail after earlier entries have already been applied. Retraction targets the supplied predicate, not a wildcard pattern.
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Add an ordinary belief with this name and arguments. |
Action |
|
Add each function-term entry sequentially. |
Action |
|
Drop the supplied ordinary belief. |
Action |
|
Drop each function-term entry sequentially. |
astra.lang.Console
Reads from Java standard input and writes to standard output. println includes the agent name and a newline; print omits both. Input readers bind their output parameter and require suitable input. readString also prints diagnostic messages in this implementation. There is no read(...) alias: use readString(...).
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print with agent prefix and newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print without prefix or newline. |
Action |
|
Print the canonical Java class name. |
Action |
|
Read and bind a int value. |
Action |
|
Read and bind a long value. |
Action |
|
Read and bind a float value. |
Action |
|
Read and bind a double value. |
Action |
|
Read and bind a string value. |
astra.lang.Debug
Prints internal state for diagnosis. Belief dumps show the ordinary belief base; use an environment adapter’s dump action for its observations. dumpAgentRulesForEvent filters using the event’s exact printed representation. These tools are intended for diagnostics, not as a stable data exchange format. From ASTRA 2.8.1, the module also tells agents when the program is being debugged (see Debugging in VS Code).
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Print ordinary beliefs. |
Action |
|
Print beliefs matching a predicate name. |
Action |
|
Print the explanation stack. |
Action |
|
Print rules matching an event representation. |
Action |
|
Print the current intention stack. |
Action |
|
Print pending events. |
Formula |
|
True while a debugger is connected to the program. |
Formula |
|
True while the named agent is stopped by the debugger. |
Event |
|
A debugger has connected to the program. |
Event |
|
The debugger has disconnected; stopped agents have resumed. |
Event |
|
The named agent has stopped in the debugger (reason: breakpoint, step, pause or entry). |
Event |
|
The named agent, which had stopped in the debugger, runs again. |
astra.lang.Functions
Inspects a funct, such as move("north", 3). functor returns its name and arity its argument count. Typed readers use zero-based argument indices. Numeric readers cast to the requested type; valueAsString uses the primitive value’s string representation. valueType returns the Java class name of a primitive argument and does not handle nested lists or functions.
Kind |
Signature |
Result / behavior |
|---|---|---|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
astra.lang.Logic
toPredicate exposes a function term as a queryable predicate with the same name and arguments. toFunctor accepts a predicate formula; other formula kinds throw an exception. eval turns a boolean term value into a formula.
Kind |
Signature |
Result / behavior |
|---|---|---|
Formula |
|
Query a function term as a predicate. |
Formula |
|
Succeed exactly when the boolean is true. |
Term |
|
|
astra.lang.Math
Numeric parsers trim whitespace and use Java parsing rules; malformed or out-of-range input throws an exception. randomInt(bound) requires a positive bound and returns a value from zero inclusive to the bound exclusive. Unbounded randomInt() applies absolute value to a random Java integer: the minimum integer can remain negative. abs has the same minimum-integer overflow limitation. min, max and abs accept integers only.
Kind |
Signature |
Result / behavior |
|---|---|---|
Formula |
|
Succeed exactly when the boolean is true. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
astra.lang.Messaging
Configures transports used by ASTRA’s send statement. Install, configure and start each service once for the JVM. Transport classes must implement astra.messaging.MessageService and be on the classpath. installService logs construction errors but still returns success, so action success alone does not prove installation. Configuration keys depend on the transport. See Agent Communication.
module Messaging messaging;
plan +!main(list args) {
messaging.installService("local", "astra.messaging.LocalMQService");
messaging.startService("local");
}
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Install a named message transport. |
Action |
|
Configure a named transport. |
Action |
|
Start the named transport. |
astra.lang.ObjectAccess
Uses Java reflection on public fields. create requires a public no-argument constructor and returns an Object; a custom module is preferable when a strongly typed result is required. set returns failure for reflection errors, while getters throw. toList requires a Collection field. invoke looks up a method with no parameter types, so it is usable for public no-argument methods; it is not a general overloaded-method dispatcher. The string overload of is uses Java reference equality: use strings.equal(oa.getString(obj, "field"), "value") for content equality.
Kind |
Signature |
Result / behavior |
|---|---|---|
Term |
|
|
Formula |
|
Compare a public field with a value; see string caveat. |
Formula |
|
Compare a public field with a value; see string caveat. |
Formula |
|
Compare a public field with a value; see string caveat. |
Formula |
|
Compare a public field with a value; see string caveat. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Action |
|
Write a public field. |
Action |
|
Write a public field. |
Action |
|
Write a public field. |
Action |
|
Write a public field. |
Term |
|
|
Action |
|
Invoke a public no-argument method. |
Formula |
|
Test Java class membership. |
Term |
|
|
astra.lang.Prelude
Provides list operations. add, addAt, remove, shuffle, sorting, swap and reverse mutate the supplied list; tail returns a new list. Do not use a head reader on an empty list. Sorting requires mutually comparable values. contains has no boolean or general object overload.
The *ValueFor readers find the first function term with the requested functor in a list, then read argument zero or the supplied index. A missing functor or mismatched type throws. fromASTRAList expects primitive-wrapped values; toASTRAList and toList wrap Java list entries. toObjectArray returns ASTRA term objects, rather than unwrapped Java values. mapToList creates [key, value] pairs; fromMap creates key(value) function terms. toMap accepts function terms or two-element lists and converts keys and values to strings.
module Prelude prelude;
plan +!main(list args) {
list Values = [3, 1, 2];
prelude.sort_asc(Values);
int First = prelude.headAsInt(Values);
int Count = prelude.size(Values);
}
Kind |
Signature |
Result / behavior |
|---|---|---|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Action |
|
Append a value in place. |
Action |
|
Append a value in place. |
Action |
|
Append a value in place. |
Action |
|
Append a value in place. |
Action |
|
Append a value in place. |
Action |
|
Append a value in place. |
Action |
|
Append a value in place. |
Action |
|
Append a value in place. |
Action |
|
Insert at an index in place. |
Action |
|
Insert at an index in place. |
Action |
|
Insert at an index in place. |
Action |
|
Insert at an index in place. |
Action |
|
Insert at an index in place. |
Action |
|
Insert at an index in place. |
Action |
|
Insert at an index in place. |
Action |
|
Insert at an index in place. |
Action |
|
Remove the indexed entry in place. |
Term |
|
|
Formula |
|
Test whether the collection is empty. |
Formula |
|
Test membership or substring occurrence. |
Formula |
|
Test membership or substring occurrence. |
Formula |
|
Test membership or substring occurrence. |
Formula |
|
Test membership or substring occurrence. |
Formula |
|
Test membership or substring occurrence. |
Formula |
|
Test membership or substring occurrence. |
Formula |
|
Test membership or substring occurrence. |
Formula |
|
Test membership or substring occurrence. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Action |
|
Randomly reorder in place. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Action |
|
Sort in ascending order in place. |
Action |
|
Sort in descending order in place. |
Action |
|
Exchange two indexed values in place. |
Action |
|
Reverse in place. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
astra.lang.Reflection
Legacy placeholder. addRole currently returns success without changing the agent; it does not implement dynamic role assignment. Use Multiple Inheritance for class reuse and Callable Goals for dynamic goal invocation.
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
No-op placeholder; always succeeds. |
astra.lang.Strings
String comparisons are case-sensitive except equalsIgnoreCase. charAt uses a zero-based Java character index. split takes a Java regular expression, not a literal delimiter, and discards trailing empty tokens. replaceAll also uses Java regular expressions and replacement-group syntax.
module Strings strings;
plan +!main(list args) {
list Words = strings.split("one,two,three", ",");
string Clean = strings.replaceAll("room 12", "[0-9]+", "X");
}
Kind |
Signature |
Result / behavior |
|---|---|---|
Formula |
|
Compare string contents. |
Formula |
|
Compare without case distinctions. |
Formula |
|
Test a prefix. |
Formula |
|
Test a suffix. |
Formula |
|
Test membership or substring occurrence. |
Term |
|
|
Term |
|
|
Term |
|
|
astra.lang.System
Manages agents registered through this module and the shared runtime. createAgent creates and schedules an agent; it does not post its main goal. Call setMainGoal separately. Names must be unique. terminateAgent permits the creator or the target itself to terminate the target; terminate affects the current agent. exit ends the JVM and all agents.
Environment configuration
sleep delays the calling action in milliseconds. Prefer Agenda for scheduled goals or Timer for periodic events. Scheduler settings affect the shared runtime. env(variable) returns null for an unset variable. env(variable, fallback) uses the fallback for a missing or blank value and otherwise preserves the string unchanged. envInt(variable, fallback) also falls back for missing or blank values, trims surrounding whitespace before integer parsing, and throws NumberFormatException for malformed or out-of-range integers. getType(name) returns "none" for an unknown agent. deconstruct captures serializable beliefs, name and type, not intentions, pending events or module state; reconstruct is not a complete runtime checkpoint.
The System registry contains agents attached to this module and agents created or reconstructed through it; getAgents() and agentExists() describe that registry, not a discovery service for every possible agent. Attaching the module registers the agent with no creator; creation/reconstruction records the caller as creator. Registry removal notifications forget terminated agents even when termination occurs outside System (for example through Platform.shutdown(...)), and only remove an entry if it still refers to the removed agent object. Ownership controls terminateAgent, but does not imply that terminating a parent automatically terminates its children.
hasChildren can encounter a null owner entry in this implementation; use getChildren() and a list-size check when needed. Rule/event manipulation uses Java runtime objects and is an advanced API.
module System system;
plan +!main(list args) {
string Host = system.env("ASTRA_HOST", "localhost");
int Port = system.envInt("ASTRA_PORT", 8080);
system.createAgent("worker", "examples.Worker");
system.setMainGoal("worker", []);
}
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Succeed without an effect. |
Term |
|
|
Action |
|
Fail the calling action. |
Action |
|
Terminate the current agent. |
Action |
|
Create and schedule a named agent. |
Action |
|
Post main(args) to the named agent. |
Action |
|
Terminate an owned agent or self. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Action |
|
Enqueue a Java event. |
Action |
|
Add a runtime rule. |
Action |
|
Add or replace a runtime rule. |
Action |
|
Remove a runtime rule; fails if the agent does not have it (since 2.7.9). |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Formula |
|
Test whether an ASTRA class can be loaded. |
Formula |
|
Test for owned agents; see implementation caveat. |
Formula |
|
Test whether this agent has a creator. |
Action |
|
Stop the runtime and exit the JVM. |
Action |
|
Delay the action in milliseconds. |
Term |
|
|
Action |
|
Set scheduler thread pool size. |
Action |
|
Load a scheduler strategy class. |
Term |
|
|
Formula |
|
Test whether a name is registered. |
Term |
|
|
Action |
|
Create and schedule an agent from captured state. |
Term |
|
|
Action |
|
Set scheduler sleep duration in milliseconds. |
Action |
|
Print per-agent timing statistics. |
Action |
|
Enable or disable agent tracing. |
Action |
|
Set the current agent to stepping mode. |
astra.lang.Goals
Constructs native dynamic subgoals and reads named outputs. fromString returns a fresh astra.core.GoalInvocation, executed with ASTRA’s invoke statement. Each invocation executes once. Output readers require successful completion, the exact output name and the matching type. callables returns the agent’s callable contracts, including inherited metadata. See Callable Goals and Dynamic Invocation for a complete example and annotation rules.
Kind |
Signature |
Result / behavior |
|---|---|---|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
astra.lang.Memory
Since ASTRA 2.6.0. Lets an agent that has been restarted recover from what it remembers of its previous life. This is weak recovery: as with weak migration, the agent’s data survives but its intentions do not. The agent starts afresh, with its initial beliefs, and decides itself what to take back. The memory never changes the agent’s beliefs.
The memory is kept by astra.trace.AgentMemory. Start the JVM with -Dastra.memory=<directory> to keep a memory for every agent. Each agent then has a snapshot, taken periodically and at shutdown, plus a log of changes. These record the agent’s beliefs and its goal set: the top-level achievement goals (!!goal, other than main) that it adopted and that had neither been achieved nor failed. Subgoals are not remembered, because they belong to an intention. When an agent with the same name is created again with the same directory, it receives a $memory.restarted() event. It keeps the memory until it calls memory.recovered(), so if it is restarted again mid-recovery, it gets the same memory again rather than the half-recovered state.
agent Main {
module Console console;
module Memory memory;
module Timer timer;
module System system;
types counter {
formula count(int);
formula counting(string);
}
rule +!main(list args) {
if (~memory.remembers()) {
console.println("starting afresh");
+count(0);
!!counting("tick");
}
}
rule $memory.restarted() {
if (memory.believed(count(int n))) {
console.println("remembered count " + n);
+count(n);
}
foreach (memory.wasPursuing(counting(string name))) {
console.println("resuming " + name);
!!counting(name);
}
memory.recovered();
}
rule +!counting(string name) {
timer.every(name, 500);
wait(false);
}
rule $timer.tick(string name) : count(int n) {
-+count(n + 1);
console.println("count " + (n + 1));
if (n + 1 == 6) system.exit();
}
}
Run it with MAVEN_OPTS="-Dastra.memory=memory" mvn compile astra:deploy and stop it after count 3. Run it again with the same directory. It prints remembered count 3 and resuming tick, then continues from count 4. believed and wasPursuing are formulae with one solution for each remembered belief or goal that matches the pattern, so foreach visits every match.
Kind |
Signature |
Result / behavior |
|---|---|---|
Event |
|
The agent has a memory of a previous life. |
Formula |
|
True if the agent remembers a previous life and has not yet called |
Formula |
|
One solution for each remembered belief that matches the pattern, binding its variables. |
Formula |
|
One solution for each remembered goal that matches the pattern, binding its variables. |
Term |
|
|
Action |
|
The agent has recovered; its memory of the previous life is forgotten. |
astra.lang.Timer
Schedules periodic events without a sleeping intention. Intervals are positive milliseconds. The first tick occurs after one interval. Reusing a timer name replaces that agent’s existing timer; cancel also succeeds if no timer exists. Timers stop when their agent terminates. Tick handling follows normal event scheduling, so keep handlers short enough for the chosen interval.
module Timer timer;
module Console console;
plan +!main(list args) {
timer.every("refresh", 1000);
}
plan $timer.tick("refresh") {
console.println("refresh");
timer.cancel("refresh");
}
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Schedule or replace a named periodic timer. |
Action |
|
Cancel this agent’s named timer. |
Event |
|
Named periodic tick. |
astra.lang.Logger
Wraps Java logging using the agent’s name. Use supported uppercase level strings. Java handler configuration also controls which messages appear. setLogProperties loads a Java logging configuration file. The current INFO() term incorrectly returns "FINEST"; use the literal "INFO" or the info action. The other level terms return their named levels.
module Logger logger;
plan +!main(list args) {
logger.setLevel("INFO");
logger.info("agent ready");
}
Kind |
Signature |
Result / behavior |
|---|---|---|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Action |
|
Set the logger threshold. |
Action |
|
Load Java logging configuration. |
Action |
|
Log a message at the given level. |
Action |
|
Log at FINER level. |
Action |
|
Log at FINE level. |
Action |
|
Log at CONFIG level. |
Action |
|
Log at INFO level. |
Action |
|
Log at WARNING level. |
Action |
|
Log at SEVERE level. |
astra.lang.Compiler
Compiles rules, events and formulae from strings at runtime, so that an agent can add plans while it runs (for example in a missing plan plan). Source is checked as the ASTRA compiler checks it, against the types and modules declared by the agent’s class and its parents, so a compiled rule can use the same beliefs, goals and module actions, terms and formulae as the agent’s own plans. The leading rule or plan keyword is optional. Install compiled rules with System.addRule or System.addOrReplaceRule.
Constants, module event triggers ($module.event), encapsulated goals with inner plans, teleo-reactive functions, learning processes and explain are not supported in rules compiled at runtime. Since 2.7.9, rules compiled at runtime can use modules’ automatic actions and formulae, such as CArtAgO operations. The agent’s classes must have been compiled with ASTRA 2.7.7 or later.
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Compile a rule; fails if the source does not compile. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
astra.lang.ExplanationAccess
Advanced access to the agent’s explanation store. Uses astra.core.Rule and astra.explanation.Explanation Java objects. Retrieval can be filtered by rule or tag; tag/value methods narrow the match. Check isEmpty and hasRule before reading explanation contents. See Debug for a console dump.
Kind |
Signature |
Result / behavior |
|---|---|---|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Formula |
|
Test for an associated rule. |
Formula |
|
Test whether the collection is empty. |
Term |
|
|
astra.util.DB
JDBC database access. Declare module astra.util.DB db; and add your database’s JDBC driver dependency. getConnection binds a java.sql.Connection; close it when finished. Query builders return astra.util.SQLQuery objects. Supply parallel field/value lists of matching lengths. Raw SQL methods execute the supplied SQL directly; construct and validate SQL for your database deliberately. where adds constraints to a query, get executes a selection and binds a list of rows, and update executes a modification.
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Load a JDBC driver class. |
Formula |
|
Test for a database table. |
Action |
|
Open a JDBC connection. |
Action |
|
Close a JDBC connection. |
Action |
|
Execute raw modification SQL. |
Action |
|
Execute raw selection SQL and bind rows. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Action |
|
Add query constraints. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Action |
|
Execute a selection query and bind rows. |
Term |
|
|
Action |
|
Execute a modification query. |
astra.util.TupleSpace
Shared in-process named key/value spaces. Declare module astra.util.TupleSpace tuples;. Join a space before posting or reading; use hasSpace and hasTuple before typed getters. A post associates a key with a value and can replace that value. These getters read without consuming the entry. Values must match the requested getter type. Space membership is per agent; the data is shared among participants in the JVM.
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Join a named space. |
Action |
|
Leave a named space. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Action |
|
Store or replace a keyed value. |
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Term |
|
|
Formula |
|
Test whether a keyed value exists. |
Formula |
|
Test whether a named space exists. |
Term |
|
|
astra.util.Logging
Legacy Java logging wrapper. Declare module astra.util.Logging logging;. Its accepted level names and logger configuration follow Java logging. Prefer astra.lang.Logger for new agents; the legacy wrapper also exposes a finest action.
Kind |
Signature |
Result / behavior |
|---|---|---|
Action |
|
Set the logger threshold. |
Action |
|
Log a message at the given level. |
Action |
|
Log at SEVERE level. |
Action |
|
Log at WARNING level. |
Action |
|
Log at INFO level. |
Action |
|
Log at FINE level. |
Action |
|
Log at FINER level. |
Action |
|
Log at FINEST level. |