This is not something that you can do in pure
Java. To do this in C, you'd either have to start a sub-process to handle each client request, or you'd have to have a single-threaded server that switched EUIDs for each client. In Java, the first alternative is certainly open to you; you'd need to fork the children through a small "glue" program wihch would do the the seteuid() call, then start the JVM.
As far as the second alternative: I'm not sure if this would work or not, but you could certainly try it: write a native method wrapper for seteuid(), and then make sure you only handled client requests on a single
thread.