package com.practicaljava.lesson25;

import java.net.MalformedURLException;
import java.rmi.RemoteException;
import java.rmi.Naming;

public class StartServer {

  public static void main (String args[]) {
	  
   //System.setProperty("java.security.policy", "Users/yfain11/practicalJava/lesson25.security.policy");
	  
   try {  

	//if (System.getSecurityManager() == null) {
	//          System.setSecurityManager(new  RMISecurityManager());
    //}
	   
    StockServerImpl ssi = new StockServerImpl();
    Naming.rebind("rmi://localhost:1099/QuoteService",ssi);

    System.out.println("<QuoteService> server is ready.");

   }catch (MalformedURLException e1){
	  System.out.println(e1.getMessage());   
   }catch(RemoteException ex) {
	   ex.printStackTrace();
   }
  }
}
