Class RmiExamples
java.lang.Object
net.jrodolfo.java_evolution.java01.rmi.RmiExamples
Demonstrates Remote Method Invocation, introduced in Java 1.1.
Early RMI examples commonly used generated stubs. Modern JDKs use dynamic
stubs, so this example keeps the historically important API shape without
requiring obsolete rmic generated source.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSerializable argument passed to the remote service.static interfaceRemote contract.static final classLocal owner for the registry and exported remote object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionStarts a local RMI registry, constructs an exported remote object, and binds the service.
-
Constructor Details
-
RmiExamples
public RmiExamples()
-
-
Method Details
-
startGreetingService
Starts a local RMI registry, constructs an exported remote object, and binds the service.- Returns:
- local RMI endpoint that must be closed after use
- Throws:
IOException- when local socket binding or object export fails
-