home *** CD-ROM | disk | FTP | other *** search
- package java.rmi.registry;
-
- import java.rmi.RemoteException;
- import java.rmi.UnknownHostException;
-
- public final class LocateRegistry {
- private static String registryPkgPrefix = System.getProperty("java.rmi.registry.packagePrefix", "sun.rmi.registry");
- private static RegistryHandler handler = null;
-
- private LocateRegistry() {
- }
-
- public static Registry getRegistry() throws RemoteException {
- try {
- return getRegistry((String)null, 1099);
- } catch (UnknownHostException var0) {
- return null;
- }
- }
-
- public static Registry getRegistry(int var0) throws RemoteException {
- try {
- return getRegistry((String)null, var0);
- } catch (UnknownHostException var1) {
- return null;
- }
- }
-
- public static Registry getRegistry(String var0) throws RemoteException, UnknownHostException {
- return getRegistry(var0, 1099);
- }
-
- public static Registry getRegistry(String var0, int var1) throws RemoteException, UnknownHostException {
- if (handler != null) {
- return handler.registryStub(var0, var1);
- } else {
- throw new RemoteException("No registry handler present");
- }
- }
-
- public static Registry createRegistry(int var0) throws RemoteException {
- if (handler != null) {
- return handler.registryImpl(var0);
- } else {
- throw new RemoteException("No registry handler present");
- }
- }
-
- static {
- try {
- Class var0 = Class.forName(registryPkgPrefix + ".RegistryHandler");
- handler = (RegistryHandler)var0.newInstance();
- } catch (Exception var1) {
- }
- }
- }
-