Package slrtp
SLPackage #sleela 3.0 (lib/slrtp/SLPackage.sleela)
SLPackage class
Defines the SLeeLa standard-library package for slrtp -- the Sleela Retrouval Tactical Processor, SLeeLa's AOP-style interception framework (aspects, pointcuts, join points, before / after / around advice). This facade exposes the package to the SLeeLa compiler, Loader, and Nordshrift.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
packageName | String packageName() | No description in source. |
slrtp-demo #sleela 3.0 (lib/slrtp/slrtp-demo.sleela)
SlrtpDemo class
A runnable demonstration of SLRTP (Sleela Retrouval Tactical Processor), SLeeLa's AOP-style interception framework. It builds a tracing aspect and a guard aspect, installs them in a processor, and shows a target service weaving the processor around its own method -- before advice, an around advice that substitutes a cached result, and after-returning advice. Run it: sleela run lib/slrtp/slrtp-demo.sleela Sibling classes (SLRTPJoinPoint, SLRTPPointcut, SLRTPAdvice, SLRTPProcessor, SLRTPAspect) are auto-linked from this directory; no imports are needed.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
charge | String charge(SLRTPProcessor p, String account, int cents) | No description in source. |
main | void main() | No description in source. |
SLRTPAdvice #sleela 3.0 (lib/slrtp/SLRTPAdvice.sleela)
SLRTPAdvice class
An SLRTP advice -- the action taken at the join points its pointcut selects, akin to Java/AspectJ before / after-returning / after-throwing / around advice. Because the SLeeLa semantic checker is nominal and does not upcast, advice is DATA-DRIVEN rather than subclassed: an advice carries a pointcut plus an action code, and the processor applies the built-in action when the advice fires. The built-in actions cover the common cross-cutting concerns (tracing, counting, and around short-circuit / return-substitution); the join point it receives is mutable, so an around advice can decline to proceed or rewrite the return value.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
ACTION_LOG | int ACTION_LOG = 0 | No description in source. |
ACTION_COUNT | int ACTION_COUNT = 1 | No description in source. |
ACTION_SKIP | int ACTION_SKIP = 2 | No description in source. |
ACTION_SUBSTITUTE | int ACTION_SUBSTITUTE = 3 | No description in source. |
name | String name = "advice" | No description in source. |
pointcut | SLRTPPointcut pointcut | No description in source. |
action | int action = 0 | No description in source. |
substituteValue | String substituteValue = "" | No description in source. |
hits | int hits = 0 | No description in source. |
lastTrace | String lastTrace = "" | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
define | void define(String adviceName, SLRTPPointcut pc, int act, String subValue) | No description in source. |
getName | String getName() | No description in source. |
getPointcut | SLRTPPointcut getPointcut() | No description in source. |
getAction | int getAction() | No description in source. |
getHits | int getHits() | No description in source. |
getLastTrace | String getLastTrace() | No description in source. |
appliesTo | boolean appliesTo(SLRTPJoinPoint jp) | True when this advice applies to the join point. |
fire | boolean fire(SLRTPJoinPoint jp) | No description in source. |
SLRTPAspect #sleela 3.0 (lib/slrtp/SLRTPAspect.sleela)
SLRTPAspect class
An SLRTP aspect -- a named bundle of advice that address one cross-cutting concern (tracing, metering, access control), akin to a Java/AspectJ @Aspect. An aspect collects its advice, then installs them all into an SLRTPProcessor in one call, so a concern is enabled or disabled as a unit.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
name | String name = "aspect" | No description in source. |
MAX_ADVICE | int MAX_ADVICE = 32 | No description in source. |
advice | SLRTPAdvice[] advice = new SLRTPAdvice[32] | No description in source. |
adviceCount | int adviceCount = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
named | void named(String aspectName) | No description in source. |
getName | String getName() | No description in source. |
getAdviceCount | int getAdviceCount() | No description in source. |
add | boolean add(SLRTPAdvice a) | Add one advice to this aspect. Returns false when the aspect is full. |
installInto | int installInto(SLRTPProcessor p) | No description in source. |
SLRTPJoinPoint #sleela 3.0 (lib/slrtp/SLRTPJoinPoint.sleela)
SLRTPJoinPoint class
A join point in SLRTP (Sleela Retrouval Tactical Processor) -- one described point in a program's execution that advice can act on, akin to a Java/AspectJ join point. It names the target type and method, the current phase (before / after-returning / after-throwing / around), the call's argument summary, and carries the mutable return / proceed state that around advice reads and rewrites.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
PHASE_BEFORE | int PHASE_BEFORE = 0 | No description in source. |
PHASE_AFTER_RETURNING | int PHASE_AFTER_RETURNING = 1 | No description in source. |
PHASE_AFTER_THROWING | int PHASE_AFTER_THROWING = 2 | No description in source. |
PHASE_AROUND | int PHASE_AROUND = 3 | No description in source. |
typeName | String typeName = "" | Identity of the intercepted call. |
methodName | String methodName = "" | No description in source. |
phase | int phase = 0 | No description in source. |
args | String args = "" | No description in source. |
argCount | int argCount = 0 | No description in source. |
returnValue | String returnValue = "" | No description in source. |
thrown | String thrown = "" | No description in source. |
proceeded | boolean proceeded = true | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
describe | void describe(String type, String method, int ph, String argSummary, int count) | Build a fully-specified join point. |
getTypeName | String getTypeName() | No description in source. |
getMethodName | String getMethodName() | No description in source. |
getPhase | int getPhase() | No description in source. |
getArgs | String getArgs() | No description in source. |
getArgCount | int getArgCount() | No description in source. |
getReturnValue | String getReturnValue() | No description in source. |
setReturnValue | void setReturnValue(String v) | No description in source. |
getThrown | String getThrown() | No description in source. |
setThrown | void setThrown(String v) | No description in source. |
didProceed | boolean didProceed() | No description in source. |
setProceeded | void setProceeded(boolean v) | No description in source. |
phaseName | String phaseName() | The human-readable name of the current phase. |
signature | String signature() | No description in source. |
SLRTPPointcut #sleela 3.0 (lib/slrtp/SLRTPPointcut.sleela)
SLRTPPointcut class
An SLRTP pointcut -- a predicate that selects the join points an advice applies to, akin to a Java/AspectJ pointcut expression. It matches a join point on three independent fields: target type, method name, and phase. Each field is either an exact string or the universal wildcard "*" (match any). Matching uses only string equality, so it is exact and portable; it does not attempt substring or regex matching the primitive String type here cannot perform.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
typePattern | String typePattern = "*" | No description in source. |
methodPattern | String methodPattern = "*" | No description in source. |
phasePattern | String phasePattern = "*" | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
select | void select(String type, String method, String phaseLabel) | No description in source. |
getTypePattern | String getTypePattern() | No description in source. |
getMethodPattern | String getMethodPattern() | No description in source. |
getPhasePattern | String getPhasePattern() | No description in source. |
fieldMatches | boolean fieldMatches(String pattern, String value) | One field matches when the pattern is the wildcard or equals the value. |
matches | boolean matches(SLRTPJoinPoint jp) | No description in source. |
describe | String describe() | A readable rendering, e.g. "pay.* @around". |
SLRTPProcessor #sleela 3.0 (lib/slrtp/SLRTPProcessor.sleela)
SLRTPProcessor class
The Sleela Retrouval Tactical Processor -- SLRTP's weaver and dispatcher, akin to a Java/Spring AOP proxy that runs registered advice around a call. Because SLeeLa has no bytecode weaver, interception is EXPLICIT: a caller wraps a method body with runBefore / runAround / runAfterReturning / runAfterThrowing, passing a join point. The processor finds every registered advice whose pointcut matches and fires it in registration order; an around advice may short-circuit the real call (SKIP) or rewrite its result (SUBSTITUTE). The processor keeps a bounded trace log so a program or test can inspect what fired without reading stdout.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
MAX_ADVICE | int MAX_ADVICE = 64 | No description in source. |
advice | SLRTPAdvice[] advice = new SLRTPAdvice[64] | No description in source. |
adviceCount | int adviceCount = 0 | No description in source. |
MAX_TRACE | int MAX_TRACE = 256 | No description in source. |
trace | String[] trace = new String[256] | No description in source. |
traceCount | int traceCount = 0 | No description in source. |
dispatched | int dispatched = 0 | Count of join points dispatched and of around calls that were skipped. |
shortCircuits | int shortCircuits = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
register | int register(SLRTPAdvice a) | Register an advice. Returns the slot index, or -1 when full. |
getAdviceCount | int getAdviceCount() | No description in source. |
getDispatched | int getDispatched() | No description in source. |
getShortCircuits | int getShortCircuits() | No description in source. |
getTraceCount | int getTraceCount() | No description in source. |
traceAt | String traceAt(int i) | No description in source. |
recordTrace | void recordTrace(String line) | Append one line to the bounded trace ring (drops oldest when full). |
dispatch | boolean dispatch(SLRTPJoinPoint jp) | No description in source. |
runBefore | void runBefore(String type, String method, String args, int argCount) | BEFORE phase: run matching before/around advice prior to the real call. |
runAfterReturning | void runAfterReturning(String type, String method, String args, int argCount, String result) | No description in source. |
runAfterThrowing | void runAfterThrowing(String type, String method, String args, int argCount, String error) | AFTER-THROWING phase: run after the call raised, carrying an error marker. |
runAround | SLRTPJoinPoint runAround(String type, String method, String args, int argCount, String proposedResult) | No description in source. |
dumpTrace | void dumpTrace() | Print the recorded trace to stdout (for demos / debugging). |