Package io.higson.runtime.core
Class DiagnosticHigsonEngine
java.lang.Object
io.higson.runtime.core.HigsonEngineImpl
io.higson.runtime.core.DiagnosticHigsonEngine
- All Implemented Interfaces:
HigsonEngine
Diagnostic (profiling) variant of
HigsonEngineImpl.
Records a call-stack trace into a thread-local DiagnosticCallStack for every
get, call and flow invocation. The class is selected by
HigsonEngineFactory when profilerEnabled = true; when profiling is off
the plain HigsonEngineImpl is used — zero overhead, no if in the hot
path.
Top-level detection: before the first push the stack is empty (isEmpty() == true).
In the finally block of a top-level call the collected events are aggregated into
a summary and handed to the DiagnosticCallStackFlushStrategy. The strategy decides whether to dispatch
the report to the diagnostic queue (production) or preserve the stack for later inspection
(tester).
-
Constructor Summary
ConstructorsConstructorDescriptionDiagnosticHigsonEngine(ParamEngine engine, DomainCache domainCache, VersionInterceptor versionInterceptor, boolean valueNeverNull, String instanceName, DiagnosticCallStackFlushStrategy flushStrategy) -
Method Summary
Modifier and TypeMethodDescriptioncall(String functionName, ParamContext ctx, Object... args) This method calls function defined within higson, with context and optional arguments.flow(String flowName, ParamContext ctx, Object... args) This method calls flow defined within higson, with context and optional arguments.get(String parameterName, ParamContext ctx) This method tries to fetch parameter's value for givenparameterNameand contextctx.Get domain object based on given profile andobjectPath.Methods inherited from class io.higson.runtime.core.HigsonEngineImpl
cleanUpThreadResources, clearEffectiveDate, clearEffectiveSetup, clearEffectiveVersion, clearEffectiveVersion, clearEffectiveVersions, getDigest, getDomainCache, getExistingProfiles, getProfiles, isValueNeverNull, runtimeConfiguration, setEffectiveDate, setEffectiveVersion, setEffectiveVersion
-
Constructor Details
-
DiagnosticHigsonEngine
public DiagnosticHigsonEngine(ParamEngine engine, DomainCache domainCache, VersionInterceptor versionInterceptor, boolean valueNeverNull, String instanceName, DiagnosticCallStackFlushStrategy flushStrategy)
-
-
Method Details
-
get
Description copied from interface:HigsonEngineThis method tries to fetch parameter's value for givenparameterNameand contextctx. If parameter requires context for proper working(context is defined parameter's metadata), then it must be provided, so values could be fetched for matched context.Example:
HigsonEngine engine = .. // might be injected or created from HigsonEngineFactory ParamValue paramValue = engine.get("parameter.code", new HigsonContext());- Specified by:
getin interfaceHigsonEngine- Overrides:
getin classHigsonEngineImpl- Parameters:
parameterName- parameter namectx- context that is required for proper parameter fetching- Returns:
- parameter value if found, or might be null
- See Also:
-
call
Description copied from interface:HigsonEngineThis method calls function defined within higson, with context and optional arguments. Function might return value asObject.Example:
HigsonEngine engine = .. // might be injected or created from HigsonEngineFactory Object result = engine.call("function.name", new HigsonContext(), 1, 2, 3);- Specified by:
callin interfaceHigsonEngine- Overrides:
callin classHigsonEngineImpl- Parameters:
functionName- function namectx- context used by functionargs- optional argument, if function requires them- Returns:
- possible result of function call
- See Also:
-
flow
Description copied from interface:HigsonEngineThis method calls flow defined within higson, with context and optional arguments. Flow might return value asFlowResult.Example:
HigsonEngine engine = .. // might be injected or created from HigsonEngineFactory Object result = engine.flow("flow.name", new HigsonContext(), 1, 2, 3);- Specified by:
flowin interfaceHigsonEngine- Overrides:
flowin classHigsonEngineImpl- Parameters:
flowName- flow namectx- context used by functionargs- optional argument, if function requires them- Returns:
FlowResultcontaining map with flow output and trace- See Also:
-
getDomain
Description copied from interface:HigsonEngineGet domain object based on given profile andobjectPath. It will be either head object or from user's session.
How objectPath is defined: "/PLANS[LIAB]/OPTIONS[OPT1]" - where- /PLANS[LIAB] - LIAB code element within PLANS collection
- / - acts as separator between child and parent
- /OPTIONS[OPT1] - OPT1 code element within OPTIONS collection, that is child of PLANS[LIAB]
Example:
HigsonEngine engine = .. // might be injected or created from HigsonEngineFactory HigsonDomainObject root = engine.getDomain("PROFILE1", "/"); // root domain object for PROFILE1 HigsonDomainObject adminElement = engine.getDomain("PROFILE1", "/USERS[ADMIN]"); // domain object with code "ADMIN" within collection "USERS"- Specified by:
getDomainin interfaceHigsonEngine- Overrides:
getDomainin classHigsonEngineImpl- Parameters:
profile- profile codeobjectPath- full path to domain object- Returns:
- domain object if found, or null
- See Also:
-