CordappContext
Keywords: net.corda.core.cordapp.CordappContext class
Date: 2023-09-18

net.corda.core.cordapp

## Class CordappContext

- net.corda.core.cordapp.CordappContext

-     public class CordappContext

  An app context provides information about where an app was loaded from, access to its classloader, and (in the included `interface 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.

  See Also:
    `interface Cordapp`, `CordappProvider.getAppContext`, ServiceHub

- - ### Field Detail

    - #### Companion

          public static net.corda.core.cordapp.CordappContext.Companion Companion

  - ### Constructor Detail

    - #### CordappContext

          @Deprecated
          public CordappContext(@NotNull
                                            Cordapp cordapp,
                                            @Nullable
                                            SecureHash attachmentId,
                                            @NotNull
                                            java.lang.ClassLoader classLoader)

      Deprecated.

  - ### Method Detail

    - #### getCordapp

          @NotNull
          public Cordapp getCordapp()

      The cordapp this context is about

    - #### getAttachmentId

          @Nullable
          public SecureHash getAttachmentId()

      For CorDapps containing

      Contract or UpgradedContract implementations this will be populatedwith the attachment containing those class files

      See Also:
        Contract, UpgradedContract

    - #### getClassLoader

          @NotNull
          public java.lang.ClassLoader getClassLoader()

      the classloader used to load this cordapp

      's classes

    - #### getConfig

          @NotNull
          public CordappConfig getConfig()

      Configuration for this CorDapp