问题
In a J2EE application, clients (applications, JSPs, servlets, JavaBeans) access entity beans via their remote interfaces. Thus, every client invocation potentially routes through network stubs and skeletons, even if the client and the enterprise bean are in the same JVM, OS, or machine.
What's a network skeleton? Some kind of proxy? I understand a stub to be a single use connection, is that correct?
回答1:
In RMI lingo, the skeleton is the generated object that sits on the server, accepts calls from the network, unmarshals them, and forwards them on to the business object.
So....
Client Business Object -> Stub -> Network -> Skeleton -> Server Business Object
It's a rather antiquated term, though, since this sort of stuff is much more automated than it used to be in early java, where skeletons had to be explicitly generated.
回答2:
When talking about RPC, stubs and skeletons are proxies for the remotely called procedure/method on the client/server respectively.
A client invokes a stub, that stub sends a protocol request to the server. The request arrives to the skeleton at the server, which then invokes the exported method.
Typically, stubs and skeletons are autogenerated from some IDL description by some tool
来源:https://stackoverflow.com/questions/6472176/what-is-a-skeleton-in-a-network