FileDocCategorySizeDatePackage
RegistryCreator.javaAPI DocExample585Thu Nov 08 00:22:50 GMT 2001com.ora.rmibook.chapter14

RegistryCreator.java

/*
 Simple example of how to create a registry
 */
package com.ora.rmibook.chapter14;


import java.rmi.*;
import java.rmi.registry.*;


public class RegistryCreator {
    public static final int OUR_PORT = 3400;
    public static void main(String[] args) {
        try {
            Registry ourRegistry = LocateRegistry.createRegistry(OUR_PORT);
            Registry preexistingRegistry = LocateRegistry.getRegistry(1099);

            preexistingRegistry.rebind("secondary registry", ourRegistry);
        } catch (RemoteException ignored) {
        }
    }
}