Package java.rmi.registry

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


        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


    @Override
    protected void setUp() throws Exception {
        CalculatorRMIServiceImpl rmiCalculatorImpl = new CalculatorRMIServiceImpl();
        Registry rmiRegistry = LocateRegistry.createRegistry(8099);
        rmiRegistry.bind("CalculatorRMIService", rmiCalculatorImpl);
       
        scaDomain = SCADomain.newInstance("CalculatorRMIReference.composite");
        calculatorService = scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
    }
   
View Full Code Here

            // if we finally have a registry, register the repository with the
            // rmiName
            if (reg != null) {
                log.debug("Registering repository as " + rc.getRmiName()
                        + " to registry " + reg);
                reg.bind(rc.getRmiName(), remote);

                // when successfull, keep references
                this.rmiRepository = remote;
                log.info("Repository bound via RMI with name: " + rc.getRmiUri());
            } else {
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

    private CalculatorService calculatorService;

    protected void setUp() throws Exception {
        CalculatorRMIServiceImpl rmiCalculatorImpl = new CalculatorRMIServiceImpl();
        Registry rmiRegistry = LocateRegistry.createRegistry(8099);
        rmiRegistry.bind("CalculatorRMIService", rmiCalculatorImpl);
       
        scaDomain = SCADomain.newInstance("CalculatorRMIReference.composite");
        calculatorService = scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
    }
   
View Full Code Here

        try {
            testPkg.Server obj = new testPkg.Server();
            testPkg.Hello stub = (testPkg.Hello) UnicastRemoteObject.exportObject(obj, 0);
            // Bind the remote object's stub in the registry
            Registry registry = LocateRegistry.getRegistry(port);
            registry.bind("Hello", stub);

            System.err.println("Server ready");

            // now, let's test client
            testPkg.Client client = new testPkg.Client(port);
View Full Code Here

public class EmptyName {
    public static void main(String[] args) throws Exception {
        Registry impl = LocateRegistry.createRegistry(0);
        Registry stub = (Registry) RemoteObject.toStub(impl);
        stub.bind("", stub);
        stub.lookup("");
        stub.rebind("", stub);
        stub.lookup("");
        stub.unbind("");
    }
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.