RMI-IIOP and JNDI simple summary (1)
Java RMI-IIOP (Java Remote Method Invocation over the Internet Inter-ORB Protocol) Such as: distributed garbage collection, object activation, downloadable files, etc., so you can understand RMI as a simplified version of RMI-IIOP, and they have completed the most basic feature on distributed object method calls.
J2EE enforces RMI-IIOP, so you have no choice in RMI-IIOP and RMI
In order to understand, first introduce some basic concepts:
-Rpc (Remote Process Call) is the process of enabling another machine from a machine process
- Interface definition objects disclosed
- Implementation is the core logic program provided by the object
-RMI all network code is applied to interface, not executing code, in other words, all network code is available to remote processes.
So how is the RMI-IIOP to complete the remote method call?
The purpose of RMI-IIOP is actually very clear, just like calling any other Java object when calling the object on the remote machine, the existence of the network is a transparent. How does the RMI-IIOP implement this feature? Very simple, RMI-IIOP simulates the call of the remote object to the call, the so-called root program (STUB), the root program is responsible for receiving local calls of the object method, because the network is complex, so the complex problem of the network It is hidden behind it; then how can the remote object handle the implementation of the machine that makes calling it? In fact, the way the way to the client, the remote object is responsible for receiving calls from the network through a so-called program framework (Skeleton). Since this, the process of remote call actually occurs between root procedures and program frameworks, and about them are generated by the RMIC (RMI compiler), and if we don't have to manage. The function of the root procedures and program framework is to process parameters, and how the parameter is transmitted?
May have heard of the concept of object serialization, as the name suggests, becoming the object into some ordered signals that can be transmitted on the network, which involves how to change, how to restore, that is, the so-called group and unlocate group problem. Let's take a look at the parameters! When the method is called, there are two ways to pass the parameters, and the value transfer, and reference delivery are passed. Value transmission is when the calling process is generated, the remote host first instant a new copy T1 of the object T, and then modifies the value T2 of this copy. At this time, the object T does not change, and then the required object T2 Remote transmission; the reference is a remote reference to the original object T, which is not a copy of the object reference, so when it is possible to modify the remote reference to T2, the remote object has become T2 from T. This reference uses a reference transfer call. The agreement is completed, which is different from the Java language. When using an object parameter in Java, a method is copied, and the copy is a reference to the object, not the real data of the object. He must pay attention to understanding. The next question came out again, an object passed through the network, but the object references other objects, not only one, how to deal with it on the target machine? The memory address of the target can not be mapped with the referenced machine memory address! This is the way to object sequence. It can be seen that the generation of each technology is to deal with new problems, but human beings often have new issues to handle problems after adding new issues, so they have worked hard, maybe It is handled in the problem, which makes me think of Zhuangzi casual state. If we don't deal with the problem, the problem will always just be so, don't have new problems, it will not be more and more complicated, don't know that one What is the world will look like! It's awkward, and the speech is turned. It just said that the object is serialized. It is actually very simple, that is, transforming a Java object into a bit block that describes the object, and the object can be passed when it is bit block In fact, it is to pack a series of Java quotes. How to serialize, I think you should be very clear, it is to implement the java.lang.Serializable interface, which is OK, Java will deal with the remaining sequentialization and decomposition The problem is. Summary: When remote calls, all Java simple basic types are transmitted with values, namely, the parameter copy passes, does not affect the original data, and the Java.lang.Serializable interface must be implemented by value. If you want to use a reference delivery, you must implement java.rmi.remote, the root program of the object will be serialized to the remote host, and then request the remote object according to the root program, and the data held by the root program It is the same as the remote host. Solved the problem of remote calls, the next is how to locate the remote host? Next, you should eat. . . . . .
********************************************************
Zhengzhou in-dimensional software 35766615
********************************************************