Package java.rmi.registry

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


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


                } catch (NotBoundException e) {
                    // Ignore
                }
                rmiRegistries.put(Integer.toString(rmiURI.port), registry);
            }
            registry.bind(rmiURI.serviceName, serviceObject);
        } catch (AlreadyBoundException e) {
            throw new RMIHostException(e);
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
View Full Code Here

            // rmi.00=URL could not be null.
            throw new NullPointerException(Messages.getString("rmi.00")); //$NON-NLS-1$
        }
        RegistryURL url = getRegistryURL(name, false);
        Registry reg = LocateRegistry.getRegistry(url.host, url.port);
        reg.bind(url.name, obj);
    }

    public static Remote lookup(String name) throws NotBoundException, MalformedURLException,
            RemoteException {
        if (name == null) {
View Full Code Here

                } catch (NotBoundException e) {
                    // Ignore
                }
                rmiRegistries.put(Integer.toString(rmiURI.port), registry);
            }
            registry.bind(rmiURI.serviceName, serviceObject);
        } catch (AlreadyBoundException e) {
            throw new RMIHostException(e);
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
View Full Code Here

  public void bind(String name, Object obj) throws NamingException {
    checkName(name);
    Registry registry = getRegistry();
    try {
      registry.bind(toRMIName(name), (Remote) obj);
    } catch (AlreadyBoundException ex) {
      throw new NameAlreadyBoundException(name + " already bound in RMI registry " + registry);
    } catch (RemoteException ex) {
      throw new NamingException("Remote exception: " + ex.getMessage());
    }
View Full Code Here

        System.out.println("Publishing SMS Gateway Service as a RMI service");

        String serviceName = "SMSGatewayRMI";
        SMSGatewayImpl smsGatewayImpl = new SMSGatewayImpl();
        Registry rmiRegistry = LocateRegistry.createRegistry(8099);
        rmiRegistry.bind(serviceName, smsGatewayImpl);

        System.out.println("RMI server running - waiting for requests");
        System.out.println("Press enter to shutdown.");
        System.in.read();
        rmiRegistry.unbind(serviceName);
View Full Code Here

                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(port);
                }
                rmiRegistries.put(Integer.toString(port), registry);
            }
            registry.bind(serviceName, serviceObject);
        } catch (AlreadyBoundException e) {
            throw new RMIHostException(e);
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
View Full Code Here

                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(port);
                }
                rmiRegistries.put(Integer.toString(port), registry);
            }
            registry.bind(serviceName, serviceObject);
        } catch (AlreadyBoundException e) {
            throw new RMIHostException(e);
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
View Full Code Here

                } catch (RemoteException e) {
                    registry = LocateRegistry.getRegistry(null, rmiURI.port, socketFactory);
                }
                rmiRegistries.put(Integer.toString(rmiURI.port), registry);
            }
            registry.bind(rmiURI.serviceName, serviceObject);
            logger.info("RMI service registered: " + rmiURI);
            return rmiURI.toString();
        } catch (AlreadyBoundException e) {
            throw new RMIHostException(e);
        } catch (RemoteException e) {
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);
                this.rmiURI = rmiURI;
                log.info("Repository bound via RMI with name: " + rmiURI);
            } else {
                log.info("RMI registry missing, cannot bind repository via RMI");
            }
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.