KaLifetimeToken¶
@SubclassOptInRequired(markerClass = [KaPlatformInterface::class])
abstract class KaLifetimeToken
A token which is used as an anchor for determining the lifetime of a session's lifetime owner.
See the documentation for KaSession and KaLifetimeOwner to find out more about lifetime management.
Constructors¶
KaLifetimeToken¶
constructor()
Functions¶
assertIsAccessible¶
inline fun KaLifetimeToken.assertIsAccessible()
assertIsValid¶
inline fun KaLifetimeToken.assertIsValid()
assertIsValidAndAccessible¶
inline fun KaLifetimeOwner.assertIsValidAndAccessible()
See also
inline fun KaLifetimeToken.assertIsValidAndAccessible()
getInaccessibilityReason¶
abstract fun getInaccessibilityReason(): String
Returns the reason why isAccessible is false. If the lifetime token is not inaccessible, the function throws an exception.
getInvalidationReason¶
abstract fun getInvalidationReason(): String
Returns the reason why isValid is false. If the lifetime token is not invalid, the function throws an exception.
isAccessible¶
abstract fun isAccessible(): Boolean
Whether the lifetime token is currently accessible. Depending on the Analysis API platform, there are certain requirements to access the Analysis API. For example, in IntelliJ, the Analysis API must be invoked with read access.
isValid¶
Whether the lifetime token is valid, i.e. the underlying information is still up-to-date. Invalidation most often occurs after modification, such as source code or project structure changes.
Invalidity should be stable: once the lifetime token is invalid, it should not become valid again.