If performance is not a problem, and if there is a chance that other applications will fall into your "native" service, I would choose RESTful or some other kind of web service. As for re-emergence in accidents, as others have noted, just create the process as a service, and you should be good to go.
If your application is the only entity that will hit this own service, then I would prefer to go the RMI path rather than the pure socket path. IMO, RMI is a natural approach to interprocess communication (where processes are Java processes). RMI has the concept of an "activated" remote object, which would be a natural approach, taking into account your requirements (auto-spawn in case of an accident). In addition, if you use RMI, your application will talk to its own process through well-defined Java interfaces, and not to contract contracts (which can be achieved using other high-level solutions, such as web services, but a real pain when it comes to talking about raw sockets).
BTW, JFTR, we use this strategy with our production application, and it works pretty well, YMMV. :-)
source share