corda / net.corda.core.cordapp / CordappContext

CordappContext

class CordappContext

An app context provides information about where an app was loaded from, access to its classloader, and (in the included Cordapp object) lists of annotated classes discovered via scanning the JAR.

A CordappContext is obtained from CordappProvider.getAppContext which resides on a ServiceHub. This will be used primarily from within flows.

Properties

attachmentId

val attachmentId: SecureHash?

For CorDapps containing Contract or UpgradedContract implementations this will be populated with the attachment containing those class files

classLoader

val classLoader: ClassLoader

the classloader used to load this cordapp's classes

config

val config: CordappConfig

Configuration for this CorDapp

cordapp

val cordapp: Cordapp

The cordapp this context is about

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.