import stock_market.*; import stock_market.stock_serverPackage.*; import org.omg.CosNaming.*; import org.omg.CosNaming.NamingContext.*; import org.omg.CORBA.*; public class stock_server extends _stock_serverImplBase { static int no_of_script; static String[] scriptname_ar; public stock_server() { no_of_script = 5; scriptname_ar = new String[no_of_script]; scriptname_ar[0] = "Procter&Gamble"; scriptname_ar[1] = "Colgate&Palmolive"; scriptname_ar[2] = "Infosys"; scriptname_ar[3] = "Wipro"; scriptname_ar[4] = "Novell"; } public int get_script_names(int how_many, scriptNameArrayHolder namearray) throws ex1 { int err = 0; if((how_many>no_of_script)||(how_many<=0)) throw new ex1("So many companys are not listed\n"); String[] return_script_params = namearray.value; /* The client fed us an array */ /* Fill the array */ for(int i=0; i< how_many; i++){ return_script_params[i] = scriptname_ar[i]; } return err; } }