FileDocCategorySizeDatePackage
ServiceServerImpl.javaAPI DocExample1248Thu Mar 24 11:57:26 GMT 2005None

ServiceServerImpl

public class ServiceServerImpl extends UnicastRemoteObject implements ServiceServer

Fields Summary
HashMap
serviceList
Constructors Summary
public ServiceServerImpl()

       // start and set up services 
       setUpServices();
    
Methods Summary
public ServicegetService(java.lang.Object serviceKey)

        
       Service theService = (Service) serviceList.get(serviceKey);       
       return theService;
    
public java.lang.Object[]getServiceList()

       System.out.println("in remote");
       return serviceList.keySet().toArray();
        
    
public static voidmain(java.lang.String[] args)

      
       try {
         Naming.rebind("ServiceServer", new ServiceServerImpl());
        } catch(Exception ex) { }
        System.out.println("Remote service is running");
    
private voidsetUpServices()

       serviceList = new HashMap<String, Service>();
       serviceList.put("Dice Rolling Service", new DiceService());  
       serviceList.put("Day of the Week Service", new DayOfTheWeekService());  
       serviceList.put("Visual Music Service", new MiniMusicService());