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 registry = LocateRegistry.getRegistry(rmiURI.host, rmiURI.port, socketFactory);

            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


        if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }
        String name = "SPRemote";
        Registry registry = LocateRegistry.getRegistry(host);
        SPRemote spremote = (SPRemote) registry.lookup(name);
        return spremote;
    }   

}
View Full Code Here

        }
        try
        {
            String name = "BookServer";
            Registry registry = LocateRegistry.getRegistry("localhost",50000);
            final BookServerInterface comp = (BookServerInterface) registry.lookup(name);

            class Parent extends JFrame implements ActionListener
            {
              JTextField titleInput = new JTextField(30);
              JButton btnSearch = new JButton("Search");
View Full Code Here

        }
        try
        {
            String name = "BookServer";
            Registry registry = LocateRegistry.getRegistry("localhost",50000);
            final BookServerInterface comp = (BookServerInterface) registry.lookup(name);

      List<BookDTO> books = comp.listBooks(null,null, null);
     
            for(BookDTO book: books)
            {
View Full Code Here

   
    /** Creates a new instance of InstanceQuery */
    public InstanceQuery() throws RemoteException, NotBoundException {
       
        Registry registry = LocateRegistry.getRegistry();          
        m_appstub = (AppMessage) registry.lookup("AppMessage");
    }
   
    public AppMessage getAppMessage() {
        return m_appstub;
    }
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

        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

     *          If some error occurs.
     */
    private void mainTestBody() throws Exception {
        Registry reg = LocateRegistry.getRegistry(REGISTRY_HOST);
        System.err.println("Registry located.");
        MyRemoteInterface mri = (MyRemoteInterface) reg.lookup("MyRemoteObject");
        System.err.println("Lookup object is: " + mri);
        Remote obj;

        // test_String_Void
        System.err.println("Testing test_String_Void...");
View Full Code Here

    private void runTestClient0(int config) throws Exception {
        System.err.println("Test client started");
        System.setSecurityManager(new RMISecurityManager());
        setEnvironmentForConfig(config);
        Registry reg = LocateRegistry.getRegistry();
        MyRemoteInterface1 mri = (MyRemoteInterface1) reg.lookup(TEST_STRING_1);
        mri.test1();
        System.err.println("Test client completed");
    }

    /**
 
View Full Code Here

   * @throws RemoteException
   * @throws NotBoundException
   */
  private ServerGoodList() throws RemoteException, NotBoundException {
    Registry registry = LocateRegistry.getRegistry(12000);
    this.database = (DatabaseInterface)registry.lookup(DatabaseInterface.class.getCanonicalName());
  }
 
  /**
   * Get the instance of the ServerSideGoodList.
   *
 
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.