Today we use xpages as entry point for our own webservices. Doing this we set rendered to false an call the java code server side via ssjs. E.g from beforeRenderResponse.
In java you than have a Servlet with a given user context, which is very comfortable. Afterwards one can write the SinglePageApplication with the java script framework of choice and just paste it to the web/inf folder.
Would be great to get a native java entry point to define the java class to be called instead of "nashorn" ssjs code to call java.