Home › Packages › slrtp

Package slrtp

This package contains 7 source unit(s) defining 7 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.

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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
packageNameString 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.

MethodSignatureWhat it does
chargeString charge(SLRTPProcessor p, String account, int cents)No description in source.
mainvoid 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
ACTION_LOGint ACTION_LOG = 0No description in source.
ACTION_COUNTint ACTION_COUNT = 1No description in source.
ACTION_SKIPint ACTION_SKIP = 2No description in source.
ACTION_SUBSTITUTEint ACTION_SUBSTITUTE = 3No description in source.
nameString name = "advice"No description in source.
pointcutSLRTPPointcut pointcutNo description in source.
actionint action = 0No description in source.
substituteValueString substituteValue = ""No description in source.
hitsint hits = 0No description in source.
lastTraceString lastTrace = ""No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
definevoid define(String adviceName, SLRTPPointcut pc, int act, String subValue)No description in source.
getNameString getName()No description in source.
getPointcutSLRTPPointcut getPointcut()No description in source.
getActionint getAction()No description in source.
getHitsint getHits()No description in source.
getLastTraceString getLastTrace()No description in source.
appliesToboolean appliesTo(SLRTPJoinPoint jp)True when this advice applies to the join point.
fireboolean 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
nameString name = "aspect"No description in source.
MAX_ADVICEint MAX_ADVICE = 32No description in source.
adviceSLRTPAdvice[] advice = new SLRTPAdvice[32]No description in source.
adviceCountint adviceCount = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
namedvoid named(String aspectName)No description in source.
getNameString getName()No description in source.
getAdviceCountint getAdviceCount()No description in source.
addboolean add(SLRTPAdvice a)Add one advice to this aspect. Returns false when the aspect is full.
installIntoint 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
PHASE_BEFOREint PHASE_BEFORE = 0No description in source.
PHASE_AFTER_RETURNINGint PHASE_AFTER_RETURNING = 1No description in source.
PHASE_AFTER_THROWINGint PHASE_AFTER_THROWING = 2No description in source.
PHASE_AROUNDint PHASE_AROUND = 3No description in source.
typeNameString typeName = ""Identity of the intercepted call.
methodNameString methodName = ""No description in source.
phaseint phase = 0No description in source.
argsString args = ""No description in source.
argCountint argCount = 0No description in source.
returnValueString returnValue = ""No description in source.
thrownString thrown = ""No description in source.
proceededboolean proceeded = trueNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
describevoid describe(String type, String method, int ph, String argSummary, int count)Build a fully-specified join point.
getTypeNameString getTypeName()No description in source.
getMethodNameString getMethodName()No description in source.
getPhaseint getPhase()No description in source.
getArgsString getArgs()No description in source.
getArgCountint getArgCount()No description in source.
getReturnValueString getReturnValue()No description in source.
setReturnValuevoid setReturnValue(String v)No description in source.
getThrownString getThrown()No description in source.
setThrownvoid setThrown(String v)No description in source.
didProceedboolean didProceed()No description in source.
setProceededvoid setProceeded(boolean v)No description in source.
phaseNameString phaseName()The human-readable name of the current phase.
signatureString 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
typePatternString typePattern = "*"No description in source.
methodPatternString methodPattern = "*"No description in source.
phasePatternString phasePattern = "*"No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
selectvoid select(String type, String method, String phaseLabel)No description in source.
getTypePatternString getTypePattern()No description in source.
getMethodPatternString getMethodPattern()No description in source.
getPhasePatternString getPhasePattern()No description in source.
fieldMatchesboolean fieldMatches(String pattern, String value)One field matches when the pattern is the wildcard or equals the value.
matchesboolean matches(SLRTPJoinPoint jp)No description in source.
describeString 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
MAX_ADVICEint MAX_ADVICE = 64No description in source.
adviceSLRTPAdvice[] advice = new SLRTPAdvice[64]No description in source.
adviceCountint adviceCount = 0No description in source.
MAX_TRACEint MAX_TRACE = 256No description in source.
traceString[] trace = new String[256]No description in source.
traceCountint traceCount = 0No description in source.
dispatchedint dispatched = 0Count of join points dispatched and of around calls that were skipped.
shortCircuitsint shortCircuits = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
registerint register(SLRTPAdvice a)Register an advice. Returns the slot index, or -1 when full.
getAdviceCountint getAdviceCount()No description in source.
getDispatchedint getDispatched()No description in source.
getShortCircuitsint getShortCircuits()No description in source.
getTraceCountint getTraceCount()No description in source.
traceAtString traceAt(int i)No description in source.
recordTracevoid recordTrace(String line)Append one line to the bounded trace ring (drops oldest when full).
dispatchboolean dispatch(SLRTPJoinPoint jp)No description in source.
runBeforevoid runBefore(String type, String method, String args, int argCount)BEFORE phase: run matching before/around advice prior to the real call.
runAfterReturningvoid runAfterReturning(String type, String method, String args, int argCount, String result)No description in source.
runAfterThrowingvoid runAfterThrowing(String type, String method, String args, int argCount, String error)AFTER-THROWING phase: run after the call raised, carrying an error marker.
runAroundSLRTPJoinPoint runAround(String type, String method, String args, int argCount, String proposedResult)No description in source.
dumpTracevoid dumpTrace()Print the recorded trace to stdout (for demos / debugging).