To "serialize a function pointer" in Java, I would consider...
  • Write the fully qualified class name + method name + fully qualified class names of parameters (with tricks for arrays, lists, etc), and use reflection to call the (presumably static) method.
  • If performance is a big issue, consider generating byte code at run time to make the calls.
  • [simpler and very fast...] Keep a Map of names to instances on each machine, and serialize "host name" and "instance name" across the wire.


With the last two, you will probably want to make calls through interfaces.