Skip to content

Tag: hook

Is it possible to hook thread creation?

I am making a plugin system and i need to see when a plugin calls Thread.start() Is there a way similar to Runtime.getRuntime().addShutdownHook but for hooking when a thread starts? Answer Byteman You can use Byteman to inject your own code into the thread.start() method. In fact, the first example to using B…