Skip to content

io microsphere process ProcessManager

github-actions[bot] edited this page Mar 21, 2026 · 1 revision

ProcessManager

Type: Class | Module: microsphere-java-core | Package: io.microsphere.process | Since: 1.0.0

Source: microsphere-java-core/src/main/java/io/microsphere/process/ProcessManager.java

Overview

Manages and tracks processes, providing methods to handle running processes and clean up resources.

This class provides functionality to:

- Add and remove unfinished processes with their respective arguments
- Retrieve an unmodifiable map of all unfinished processes
- Safely destroy a process

Example Usage

// Adding a process
Process process = Runtime.getRuntime().exec("some-command");
ProcessManager.INSTANCE.addUnfinishedProcess(process, "some-command");

// Destroying a process
ProcessManager.INSTANCE.destroy(process);

// Retrieving all unfinished processes
Map processes = ProcessManager.INSTANCE.unfinishedProcessesMap();

Declaration

public class ProcessManager

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.1.10-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 8 ✅ Compatible
Java 11 ✅ Compatible
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

// Adding a process
Process process = Runtime.getRuntime().exec("some-command");
ProcessManager.INSTANCE.addUnfinishedProcess(process, "some-command");

// Destroying a process
ProcessManager.INSTANCE.destroy(process);

// Retrieving all unfinished processes
Map<Process, String> processes = ProcessManager.INSTANCE.unfinishedProcessesMap();

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-java-core</artifactId>
    <version>${microsphere-java.version}</version>
</dependency>

Tip: Use the BOM (microsphere-java-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.process.ProcessManager;

See Also

  • Process

This documentation was auto-generated from the source code of microsphere-java.

Home

java-annotations

java-core

jdk-tools

lang-model

annotation-processor

java-test

Clone this wiki locally