If I understand correctly , you would need to code the logic you want to be reusable in a custom REST endpoint. Then a Java client could call this REST endpoint. Your implementation of generateResults() in your server side python handler (MyAwesomeModule.py) would also delegate off to this custom REST endpoint.
That answers my question. Are there any examples you would suggest to look at in splunk docs that I can reference as starting point to begin creating this kind of custom REST endpoint?