Interface ArtifactLifecycleListener


@MinMuleVersion("4.5.0") @Experimental public interface ArtifactLifecycleListener
Extensions are typically contained in Apps or Domains, which going forward we will refer to as the enclosing artifact.

This interface allows performing tasks related to the artifact's lifecycle. Notice that this is different from implementing any of the Lifecycle interfaces in any of the extension's component because:

  • An artifact can contain several instances of the same extension type, while Lifecycle is specific to each instance
  • The component's lifecycle is either not yet started or already finished by the time the artifact's lifecycle is processed

One of the most common use cases for this is performing cleanup that needs to happen when the enclosing artifact is undeployed. For instance, some JDBC Drivers or JMS brokers are known for leaking threads and memory that require custom workarounds. This listener gives the extension the chance to ship code that cleans up the right moment.

NOTE: Experimental feature. Backwards compatibility not guaranteed.

Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executed when the enclosing artifact is disposed.
  • Method Details

    • onArtifactDisposal

      void onArtifactDisposal(ArtifactDisposalContext disposalContext)
      Executed when the enclosing artifact is disposed.
      Parameters:
      disposalContext - the disposal context