Class BaseFeature<SessionStateType,EndpointType extends FeatureEndpoint>
- java.lang.Object
-
- com.opencloud.sentinel.feature.impl.BaseFeature<SessionStateType,EndpointType>
-
- Type Parameters:
SessionStateType
- The session state interface that this feature requiresEndpointType
- The endpoint interface that this feature requires
- All Implemented Interfaces:
SentinelFeature
- Direct Known Subclasses:
NullSentinelFeature
public abstract class BaseFeature<SessionStateType,EndpointType extends FeatureEndpoint> extends java.lang.Object implements SentinelFeature
Base class for POJO features.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseFeature(EndpointType caller, com.opencloud.sce.fsmtool.Facilities facilities, SessionStateType sessionState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortFeature()
The feature should abandon execution and clear up any resources.void
dependenciesInjected()
All requested elements have been injected, so the feature may carry out additional initialisation.protected EndpointType
getCaller()
protected com.opencloud.sce.fsmtool.Facilities
getFacilities()
protected SessionStateType
getSessionState()
protected com.opencloud.rhino.facilities.ExtendedTracer
getTracer()
void
startFeature(java.lang.Object trigger, java.lang.Object activity, javax.slee.ActivityContextInterface aci, java.util.Map<java.lang.String,ParameterValue> featureParameters)
kick off the feature-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.opencloud.sentinel.feature.spi.SentinelFeature
getFeatureName, startFeature
-
-
-
-
Constructor Detail
-
BaseFeature
protected BaseFeature(EndpointType caller, com.opencloud.sce.fsmtool.Facilities facilities, SessionStateType sessionState)
-
-
Method Detail
-
dependenciesInjected
public void dependenciesInjected()
All requested elements have been injected, so the feature may carry out additional initialisation. This method should be overridden by features that need to carry out additional initialisation.- Specified by:
dependenciesInjected
in interfaceSentinelFeature
-
startFeature
public void startFeature(java.lang.Object trigger, java.lang.Object activity, javax.slee.ActivityContextInterface aci, java.util.Map<java.lang.String,ParameterValue> featureParameters)
kick off the feature- Specified by:
startFeature
in interfaceSentinelFeature
- Parameters:
trigger
- a triggering context. The feature implementation must be able to cast this to a useful type for it to runactivity
- the slee activity object this feature is related to (may be null)aci
- the activity context interface of the slee activity this feature is related tofeatureParameters
- parameters supplied in the run feature statement that caused this feature to be executed
-
abortFeature
public void abortFeature()
The feature should abandon execution and clear up any resources. This method should be overridden by features that need to implement shutdown behaviour and clean up allocated resources.- Specified by:
abortFeature
in interfaceSentinelFeature
-
getSessionState
protected final SessionStateType getSessionState()
- Returns:
- the session state I have access to
-
getFacilities
protected final com.opencloud.sce.fsmtool.Facilities getFacilities()
- Returns:
- the object I use for access to common SLEE facilities
-
getTracer
protected final com.opencloud.rhino.facilities.ExtendedTracer getTracer()
- Returns:
- the tracer I use for writing trace messages
-
getCaller
protected final EndpointType getCaller()
- Returns:
- the endpoint interface I use to interact with the sentinel core
-
-