Interface ArtifactDisposalContext


@NoImplement @MinMuleVersion("4.5.0") @Experimental public interface ArtifactDisposalContext
Provides context information about the disposal of the Artifact enclosing the Extension. NOTE: Experimental feature. Backwards compatibility not guaranteed.

Since:
1.0
See Also:
  • Method Details

    • getExtensionClassLoader

      ClassLoader getExtensionClassLoader()
      Returns:
      the ClassLoader for the extension that defines the ArtifactLifecycleListener being executed
    • getArtifactClassLoader

      ClassLoader getArtifactClassLoader()
      Returns:
      the ClassLoader for the enclosing artifact that's being disposed, most typically an app or domain
    • isExtensionOwnedClassLoader

      boolean isExtensionOwnedClassLoader(ClassLoader classLoader)
      Parameters:
      classLoader - a classloader
      Returns:
      whether the given classLoader is owned by the extension that defines the ArtifactLifecycleListener being executed.
    • isArtifactOwnedClassLoader

      boolean isArtifactOwnedClassLoader(ClassLoader classLoader)
      Parameters:
      classLoader - a classloader
      Returns:
      whether the given classLoader is owned by the enclosing artifact that is being disposed, most typically an app or domain
    • getExtensionOwnedThreads

      Stream<Thread> getExtensionOwnedThreads()
      Returns a Stream with the threads that were CREATED by the extension.

      By "created" we refer to Threads that were actually explicitly instantiated by this extension or one of its libraries.

      This DOES NOT include threads that served tasks submitted through the SchedulerService, since those threads actually belong to the Mule Runtime. For those, you still need to dispose the schedulers as specified in their API.

      Returns:
      a Stream of threads
      See Also:
    • getArtifactOwnedThreads

      Stream<Thread> getArtifactOwnedThreads()
      Returns a Stream with the threads that were CREATED by the enclosing artifact that is being disposed.

      By "created" we refer to Threads that were actually explicitly instantiated by the enclosing artifact or one of its libraries.

      This DOES NOT include threads that served tasks submitted through the SchedulerService, since those threads actually belong to the Mule Runtime. For those, you still need to dispose the schedulers as specified in their API.

      Returns:
      a Stream of threads
      See Also:
    • isArtifactOwnedThread

      boolean isArtifactOwnedThread(Thread thread)
      Parameters:
      thread - a Thread
      Returns:
      whether the given thread is owned by the enclosing artifact. This will follow the same criteria described in getArtifactOwnedThreads().
      See Also:
    • isExtensionOwnedThread

      boolean isExtensionOwnedThread(Thread thread)
      Parameters:
      thread - a Thread
      Returns:
      whether the given thread is owned by either the extension that defines the ArtifactLifecycleListener being executed. This will follow the same criteria described in getExtensionOwnedThreads().
      See Also: