Package com.microej.kf.util.security
Class KernelSecurityPolicyManager
- java.lang.Object
-
- java.lang.SecurityManager
-
- com.microej.kf.util.security.KernelSecurityPolicyManager
-
- All Implemented Interfaces:
FeatureStateListener
public class KernelSecurityPolicyManager extends SecurityManager implements FeatureStateListener
This class contains the security logic to apply when working with feature policy files.
-
-
Constructor Summary
Constructors Constructor Description KernelSecurityPolicyManager(SecurityPolicyResourceLoader securityPolicyResourceLoader)Instantiates a new kernel security policy manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToPermissionMap(Feature feature)This method allows to load the feature's permissions.voidcheckPermission(Permission perm)Throws aSecurityExceptionif the requested access, specified by the given permission, is not permitted based on the security policy currently in effect.voidstateChanged(Feature feature, Feature.State previousState)Called when the state of a Feature has changed.-
Methods inherited from class java.lang.SecurityManager
checkAccess
-
-
-
-
Constructor Detail
-
KernelSecurityPolicyManager
public KernelSecurityPolicyManager(SecurityPolicyResourceLoader securityPolicyResourceLoader)
Instantiates a new kernel security policy manager.- Parameters:
securityPolicyResourceLoader- the security policy resource loader implementation.
-
-
Method Detail
-
checkPermission
public void checkPermission(Permission perm)
Description copied from class:SecurityManagerThrows aSecurityExceptionif the requested access, specified by the given permission, is not permitted based on the security policy currently in effect.- Overrides:
checkPermissionin classSecurityManager- Parameters:
perm- the requested permission.
-
addToPermissionMap
public void addToPermissionMap(Feature feature)
This method allows to load the feature's permissions. This method is already called by theKernelSecurityPolicyManagerclass when using standard LocalDeploy. This method only needs to be called when the Kernel uses XIP (Execution In Place) system to load features permissions before starting them. See the documentation for more informations.- Parameters:
feature- the feature to load permissions from.
-
stateChanged
public void stateChanged(Feature feature, @Nullable Feature.State previousState)
Description copied from interface:FeatureStateListenerCalled when the state of a Feature has changed.- Specified by:
stateChangedin interfaceFeatureStateListener- Parameters:
feature- the Feature which state has changedpreviousState- the previous state,nullif Feature state isFeature.State.INSTALLED
-
-