I am not sure where the instance of a stub for a remote object is created. Is it created when registering it in the rmiregistry by calling calling Naming.bind ? This would make sense as the registry is also called via RMI.
But can't the stub also be created by calling UnicastRemoteObject.exportObject ?
This particular code snippet from oracle confused me:
Compute engine = new ComputeEngine();
Compute stub = (Compute) UnicastRemoteObject.exportObject(engine, 0);
String name = "Compute";
Registry registry = LocateRegistry.getRegistry();
registry.rebind(name, stub);
When using Naming.bind do I need to pass a stub or a remote object?
The stub is
When using
Naming.bind()
do I need to pass a stub or a remote object?
Either. It doesn't matter, because of (2).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.