Package reactor.blockhound
Class BlockHound
java.lang.Object
reactor.blockhound.BlockHound
BlockHound is a tool to detect blocking calls from non-blocking threads.
To use it, you need to "install" it first with either
install(BlockHoundIntegration...)
or builder().
On installation, it will run the instrumentation and add the check to the blocking methods.
Note that the installation can (and should) only be done once, subsequent install calls will be ignored.
Hence, the best place to put the install call is before all tests
or in the beginning of your "public static void main" method.
If you have it automatically installed (e.g. via a testing framework integration), you can apply the customizations
by using the SPI mechanism (see BlockHoundIntegration).-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockHound.Builderbuilder()Creates a completely newBlockHound.Builderthat *does not* have any integration applied.static voidinstall(BlockHoundIntegration... integrations) Loads integrations withServiceLoader, adds provided integrations, and installs the BlockHound instrumentation.static voidpremain(String agentArgs, Instrumentation inst) Entrypoint for installation via the-javaagent=command-line option.
-
Method Details
-
builder
Creates a completely newBlockHound.Builderthat *does not* have any integration applied. Use it only if you want to ignore the built-in SPI mechanism (seeinstall(BlockHoundIntegration...)).- Returns:
- a fresh
BlockHound.Builder - See Also:
-
install
Loads integrations withServiceLoader, adds provided integrations, and installs the BlockHound instrumentation. If you don't want to load the integrations, usebuilder()method.- Parameters:
integrations- an array of integrations to automatically apply on the intermediate builder- See Also:
-
premain
Entrypoint for installation via the-javaagent=command-line option.- Parameters:
agentArgs- Options for the agent.inst- Instrumentation API.- See Also:
-