Package java.rmi.registry

Examples of java.rmi.registry.Registry.bind()


            Server obj = new Server();
            Interface stub = (Interface)UnicastRemoteObject.exportObject(obj, 0);

            // Call rmiregistry directly
            Registry registry = LocateRegistry.getRegistry(host, port);
            registry.bind("Bernoulli", stub);

            // Using JNDI
//            String sPort=(new Integer(port)).toString();
//            System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.rmi.registry.RegistryContextFactory");
//            System.setProperty(Context.PROVIDER_URL, "rmi://"+host+":"+sPort);
View Full Code Here


      }
    }
    try {
      ourStub =  UnicastRemoteObject.exportObject(ourRemote, 0);
      final String name = remote.getClass().getSimpleName() + Integer.toHexString(ourStub.hashCode());
      registry.bind(name, ourStub);

      System.out.println("Port/ID:" + port + "/" + name);
      Object lock = new Object();
      synchronized (lock) {
        lock.wait();
View Full Code Here

      // try to bind first
      try
      {
         registry = LocateRegistry.getRegistry(DEFAULT_REGISTRY_PORT);
         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());
      }
      catch (Exception e)
      {
         log.info("Failure using an existing registry, trying creating it");
View Full Code Here

      // try to bind first
      try
      {
         registry = LocateRegistry.getRegistry(DEFAULT_REGISTRY_PORT);
         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());
      }
      catch (Exception e)
      {
         log.info("Failure using an existing registry, trying creating it");
View Full Code Here

         log.info("Failure using an existing registry, trying creating it");

         // try to create it
         registry = LocateRegistry.createRegistry(DEFAULT_REGISTRY_PORT);

         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());
      }

      log.info("RMI server " + serverIndex + " bound");
   }
View Full Code Here

         // try to create it
         registry = LocateRegistry.createRegistry(DEFAULT_REGISTRY_PORT);

         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());
      }

      log.info("RMI server " + serverIndex + " bound");
   }
View Full Code Here

        MyRemoteObject obj = new MyRemoteObject();
        System.err.println("Object: " + obj + " created and exported.");
        Registry reg = LocateRegistry.createRegistry(REGISTRY_PORT);
        exportedObjects.add(reg);
        System.err.println("Registry created.");
        reg.bind("MyRemoteObject", RemoteObject.toStub(obj));
        exportedObjects.add(obj);
        System.err.println("Object bound in the registry.");
    }

    /**
 
View Full Code Here

      System.err.println("exported remote object thrice");

      Registry registry = LocateRegistry.getRegistry(
    "", TestLibrary.REGISTRY_PORT);

      registry.bind(BINDING, stubA);
      System.err.println("bound first stub in registry");

      synchronized (obj.lock) {
    obj.unreferencedInvoked = false;
View Full Code Here

    @BeforeClass
    public static void setUp() throws Exception {
        CalculatorRMIServiceImpl rmiCalculatorImpl = new CalculatorRMIServiceImpl();
        Registry rmiRegistry = LocateRegistry.createRegistry(8099);
        rmiRegistry.bind("CalculatorRMIService", rmiCalculatorImpl);
       
        String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class);
        Contribution contribution = new Contribution("c1", uri);
        node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution);
        node.start();
View Full Code Here

            if (Arrays.asList(args).contains("throwException")) {
                receiver.setOpenFileThrowsException(true);
            }

            Registry registry = LocateRegistry.createRegistry(1099);
            registry.bind("RmiJournalReceiver", receiver);
            Thread.sleep(2000);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.