Package java.rmi.registry

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


            }
            // register.
            Registry registry = getOrCreateRegistry(invoker.getUrl().getPort());
            try {
                // bind service.
                registry.bind(invoker.getUrl().getPath(), remote);
            } catch (RemoteException e) {
                throw new RpcException("Bind rmi service [" + invoker.getUrl().getPath() + "] error.",
                        e);
            } catch (AlreadyBoundException e) {
                throw new RpcException("Bind rmi service error. Service name ["
View Full Code Here


                } catch (NotBoundException e) {
                    // Ignore
                }
                rmiRegistries.put(Integer.toString(rmiURI.port), registry);
            }
            registry.bind(rmiURI.serviceName, serviceObject);
            logger.info("RMI service registered: " + rmiURI);
        } catch (AlreadyBoundException e) {
            throw new RMIHostException(e);
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
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

            // 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

        stub = UnicastRemoteObject.exportObject(proxy, endpoint.getPort());

        try {
            Registry registry = endpoint.getRegistry();
            String name = endpoint.getName();
            registry.bind(name, stub);

        } catch (Exception e) {
            // Registration might fail.. clean up..
            try {
                UnicastRemoteObject.unexportObject(stub, true);
View Full Code Here

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

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

        stub = UnicastRemoteObject.exportObject(proxy, endpoint.getPort());

        try {
            Registry registry = endpoint.getRegistry();
            String name = endpoint.getName();
            registry.bind(name, stub);

        } catch (Exception e) {
            // Registration might fail.. clean up..
            try {
                UnicastRemoteObject.unexportObject(stub, true);
View Full Code Here

            } catch (RemoteException re) {
                if(debug) System.out.println("Naming.rebind("+ proxyAddress +", eventProxy): " + re);
                try {
                    eventProxy = new EventListenerProxy();
                    Registry r = LocateRegistry.createRegistry(portnum);
                    r.bind(rmiName, eventProxy);
                    if(debug) System.out.println(rmiName + " bound to newly created registry at port " + portnum );
                } catch(Exception e) {
                    eventProxy = null;
                    if(debug) e.printStackTrace();
                }
View Full Code Here

    stub = UnicastRemoteObject.exportObject(proxy,endpoint.getPort());
   
        try {
        Registry registry = endpoint.getRegistry();
          String name = endpoint.getName();         
      registry.bind(name, stub);
     
    } catch (Exception e) { // Registration might fail.. clean up..
      try {
        UnicastRemoteObject.unexportObject(stub, true);
      } catch (Throwable e1) {
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.