CordappProvider
Keywords: net.corda.core.cordapp.CordappProvider interface
Date: 2023-09-18

net.corda.core.cordapp

## Interface CordappProvider

-     @DoNotImplement
      public CordappProvider

  Provides access to what the node knows about loaded applications.

- - ### Constructor Detail

    - #### CordappProvider

          public CordappProvider()

  - ### Method Detail

    - #### getAppContext

          @NotNull
          CordappContext getAppContext()

      Exposes the current CorDapp context which will contain information and configuration of the CorDapp that is currently running.

      The calling application is found via stack walking and finding the first class on the stack that matches any class contained within the automatically resolved `interface Cordapp`s loaded by the CordappLoader

      Throws:
        `IllegalStateException` - When called from a non-app context
      See Also:
        `interface Cordapp`, CordappLoader

    - #### getContractAttachmentID

          @Nullable
          SecureHash getContractAttachmentID(@NotNull
                                                       java.lang.String contractClassName)

      Resolve an attachment ID for a given contract name

      Parameters:
        `contractClassName` - The contract to find the attachment for
      Returns:
        An attachment ID if it exists