Each stub contains an instance of RemoteRef that contains the concrete representation of a reference. This remote reference is used to carry out remote calls on the remote object for which it is a reference. The invoke Remote,Method,Object[],long method delegates method invocation to the stub's obj remote reference and allows the reference to take care of setting up the connection to the remote host, marshaling some representation for the method and parameters, params , then communicating the method invocation to the remote host.
This method either returns the result of the method invocation on the remote object which resides on the remote host or throws a RemoteException if the call failed or an application-level exception if the remote invocation throws an exception. Note that the operation number, opnum , represents a hash of the method signature and may be used to encode the method for transmission. The method hash to be used for the opnum parameter is a bit long integer computed from the first two bit values of the message digest of a particular byte stream using the National Institute of Standards and Technology NIST Secure Hash Algorithm SHA This byte stream contains a string as if it was written using the java.
The bit hash value is the little-endian composition of an eight byte sequence where the first four bytes are the first bit value of the message digest in big-endian byte order and the last four bytes are the second bit value of the message digest in big-endian byte order.
The stubs generated by rmic using the 1. The sequence of calls consisting of newCall , invoke , and done have been replaced by a new invoke method that takes a Method object as one of its parameters. The method newCall creates an appropriate call object for a new remote method invocation on the remote object obj.
The operation array, op , contains the available operations on the remote object. The operation number, opnum , is an index into the operation array which specifies the particular operation for this remote call. The interface hash is a bit value used to enforce compatibility between a stub and skeleton using the v1. The interface hash is computed from the first two bit values of the message digest of a particular byte stream using SHA This byte stream contains data as if it was written using the writeInt and writeUTF methods of the interface java.
DataOutput , consisting of the following items:. The interface hash value is composed from the message digest in the same manner as described above for the method hash used in the invoke method. The method invoke RemoteCall executes the remote call.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile.
Linked 4. Related Hot Network Questions. Question feed. Each time the server creates an object, it registers this object with the RMIregistry using bind or reBind methods. These are registered using a unique name known as bind name.
To invoke a remote object, the client needs a reference of that object. At that time, the client fetches the object from the registry using its bind name using lookup method. Previous Page. Next Page. This stub consists of methods that invokes dispatch calls to the remote implementation of objects. The Remote Reference Layer: - The lower level transport interfaces is dealt by this layer. The Transport Layer: - The transport layer sets up the connections to remote address spaces, manages them, monitors the connection liveliness, and listens the incoming calls.
For incoming calls, the transport layer establishes a connection. An instance of RMI registry must run on every server computer that hosts remote objects The client procedure calls the client stub in the normal way.
0コメント