Package java.rmi.registry

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


            // Requires permission java.net.SocketPermission "host:port", "connect,accept,resolve"
            // in security policy.
            registry = LocateRegistry.getRegistry(host, portNumber);

            if (registry != null) {
                remoteService = registry.lookup(svcName);
            }
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
            throw rmiExec;
View Full Code Here


        String name = url.getPath();
        if (name != null && name.startsWith("/")) {
          name = name.substring(1);
        }
        Registry registry = LocateRegistry.getRegistry(host, port, this.registryClientSocketFactory);
        stub = registry.lookup(name);
      }
      else {
        // Can proceed with standard RMI lookup API...
        stub = Naming.lookup(getServiceUrl());
      }
View Full Code Here

        try {
            registry = LocateRegistry.getRegistry(host,
                portNumber);

            if (registry != null) {
                remoteService = registry.lookup(svcName);
            }
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
            throw rmiExec;
View Full Code Here

            }         
         
            // TODO This code assumes that the server has already been started.
            // Perhaps it'd be better to block until the server is available?
            Registry registry = LocateRegistry.getRegistry(host, port);
            server = (NodeMappingServer) registry.lookup(
                         NodeMappingServerImpl.SERVER_EXPORT_NAME);     
           
            // Export our client object for server callbacks.
            int clientPort = wrappedProps.getIntProperty(
                                        CLIENT_PORT_PROPERTY,
View Full Code Here

   */
  public JobService getJobService() {
    if (service == null) {
      try {
        Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
        AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
        service = auth.authenticate(username, password, JdcpUtil.PROTOCOL_VERSION_ID);
      } catch (NotBoundException e) {
        System.err.println("Job service not found at remote host.");
        System.exit(1);
      } catch (RemoteException e) {
View Full Code Here

  private JobService connect(String host, String username, String password) {
    JobService service = null;
    try {
      Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
      AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
      service = auth.authenticate(username, password, JdcpUtil.PROTOCOL_VERSION_ID);
    } catch (NotBoundException e) {
      logger.error("Job service not found at remote host.", e);
    } catch (RemoteException e) {
      logger.error("Could not connect to job service.", e);
View Full Code Here

                Registry registry = LocateRegistry.getRegistry(url.getHost(), url.getPort());
                String path = url.getPath();
                if (path == null || path.length() == 0) {
                    path = serviceType.getName();
                }
                invoker = new RmiInvoker<T>(registry, rmiProxyFactory, rmiProxyFactory.getInvoker(registry.lookup(path), serviceType, url));
            } catch (RemoteException e) {
                Throwable cause = e.getCause();
                boolean isExportedBySpringButNoSpringClass = ClassNotFoundException.class
                        .isInstance(cause)
                        && cause.getMessage().contains(
View Full Code Here

        try {
            registry = rmiRegistries.get(Integer.toString(rmiURI.port));
            if (registry == null) {
                try {
                    registry = LocateRegistry.getRegistry(rmiURI.port);
                    registry.lookup(rmiURI.serviceName);
                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(rmiURI.port);
                } catch (NotBoundException e) {
                    // Ignore
                }
View Full Code Here

            // Requires permission java.net.SocketPermission "host:port", "connect,accept,resolve"
            // in security policy.
            Registry registry = LocateRegistry.getRegistry(rmiURI.host, rmiURI.port);

            if (registry != null) {
                remoteService = registry.lookup(rmiURI.serviceName);
            }
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
            throw rmiExec;
View Full Code Here

   */
  public static JobService connect(String host, String username,
      String password) throws RemoteException, NotBoundException,
      LoginException, ProtocolVersionException {
    Registry registry = LocateRegistry.getRegistry(host, DEFAULT_PORT);
    AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
    return auth.authenticate(username, password, PROTOCOL_VERSION_ID);
  }

  /**
   * Submits a job to a server for processing.
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.