diff --git a/rmi/README.md b/rmi/README.md deleted file mode 100644 index ff12555376..0000000000 --- a/rmi/README.md +++ /dev/null @@ -1 +0,0 @@ -## Relevant articles: diff --git a/rmi/client.policy b/rmi/client.policy deleted file mode 100644 index 5d74bde76d..0000000000 --- a/rmi/client.policy +++ /dev/null @@ -1,3 +0,0 @@ -grant { - permission java.security.AllPermission; -}; \ No newline at end of file diff --git a/rmi/server.policy b/rmi/server.policy deleted file mode 100644 index 5d74bde76d..0000000000 --- a/rmi/server.policy +++ /dev/null @@ -1,3 +0,0 @@ -grant { - permission java.security.AllPermission; -}; \ No newline at end of file diff --git a/rmi/src/org/baeldung/Client.java b/rmi/src/org/baeldung/Client.java deleted file mode 100644 index 0376952bab..0000000000 --- a/rmi/src/org/baeldung/Client.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.baeldung; - -import java.rmi.NotBoundException; -import java.rmi.RemoteException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -public class Client { - public static void main(String[] args) throws RemoteException, NotBoundException { - System.setProperty("java.security.policy", "file:./client.policy"); - if (System.getSecurityManager() == null) { - System.setSecurityManager(new SecurityManager()); - } - String name = "RandomNumberGenerator"; - Registry registry = LocateRegistry.getRegistry(); - RandomNumberGenerator randomNumberGenerator = (RandomNumberGenerator) registry.lookup(name); - int number = randomNumberGenerator.get(); - System.out.println("Received random number:" + number); - } -} diff --git a/rmi/src/org/baeldung/RandomNumberGenerator.java b/rmi/src/org/baeldung/RandomNumberGenerator.java deleted file mode 100644 index 50e49d2652..0000000000 --- a/rmi/src/org/baeldung/RandomNumberGenerator.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.baeldung; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -public interface RandomNumberGenerator extends Remote{ - int get() throws RemoteException; -} diff --git a/rmi/src/org/baeldung/RandomNumberGeneratorEngine.java b/rmi/src/org/baeldung/RandomNumberGeneratorEngine.java deleted file mode 100644 index 04d90b2ff9..0000000000 --- a/rmi/src/org/baeldung/RandomNumberGeneratorEngine.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.baeldung; - -import java.rmi.RemoteException; - -public class RandomNumberGeneratorEngine implements RandomNumberGenerator { - @Override - public int get() throws RemoteException { - return (int) (100 * Math.random()); - } -} diff --git a/rmi/src/org/baeldung/Server.java b/rmi/src/org/baeldung/Server.java deleted file mode 100644 index 8e613cb6bb..0000000000 --- a/rmi/src/org/baeldung/Server.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.baeldung; - -import java.rmi.RemoteException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.rmi.server.UnicastRemoteObject; - -public class Server { - public static void main(String[] args) throws RemoteException { - System.setProperty("java.security.policy", "file:./server.policy"); - if (System.getSecurityManager() == null) { - System.setSecurityManager(new SecurityManager()); - } - String name = "RandomNumberGenerator"; - RandomNumberGenerator randomNumberGenerator = new RandomNumberGeneratorEngine(); - RandomNumberGenerator stub = - (RandomNumberGenerator) UnicastRemoteObject.exportObject(randomNumberGenerator, 0); - Registry registry = LocateRegistry.getRegistry(); - registry.rebind(name, stub); - System.out.println("RandomNumberGenerator bound"); - } -}