Package io.microsphere.process
Interface ProcessIdResolver
-
- All Superinterfaces:
java.lang.Comparable<Prioritized>
,Prioritized
- All Known Implementing Classes:
ClassicProcessIdResolver
,ModernProcessIdResolver
,VirtualMachineProcessIdResolver
public interface ProcessIdResolver extends Prioritized
A strategy interface for resolving the current process ID.Implementations of this interface are responsible for determining the identifier of the currently running process. Different implementations may be used depending on the runtime environment or operating system.
ProcessIdResolver
extendsPrioritized
, allowing implementations to define a priority value to influence the order in which they are considered when multiple resolvers are available.Example Implementation
{@code public class MyProcessIdResolver implements ProcessIdResolver { public int getPriority() { return ProcessIdResolver.NORMAL_PRIORITY; } public boolean supports() { return true; // or conditionally based on environment } public Long current() { return 12345L; // simulate process ID } }
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ModernProcessIdResolver
,ClassicProcessIdResolver
,VirtualMachineProcessIdResolver
-
-
Field Summary
Fields Modifier and Type Field Description static long
UNKNOWN_PROCESS_ID
The unknown process id-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Long
current()
Resolve the current process idboolean
supports()
Whether supports to resolve the process id or not?-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo, getPriority
-
-
-
-
Field Detail
-
UNKNOWN_PROCESS_ID
static final long UNKNOWN_PROCESS_ID
The unknown process id- See Also:
- Constant Field Values
-
-