Yes, you can certainly use walletnotify (or perhaps walletnotifynew) for this. You would do something like this in the multichain.conf file for the node:
walletnotify=/path/to/script %e %s
The script in /path/to/script would check if the first script parameter (passed by %e) represents a stream of interest, and if so, trigger the Java code, passing it the second script parameter which will contain the transaction id.
More details here: