| 1 6 7 package com.quikj.client.raccess; 8 9 import java.util.*; 10 import java.rmi.*; 11 import java.rmi.server.*; 12 16 17 18 public class AceRMIImpl extends UnicastRemoteObject implements AceRMIInterface 19 { 20 private HashMap map; 21 private static AceRMIImpl instance = null; 22 23 24 public AceRMIImpl() 25 throws RemoteException 26 { 27 super(); 28 29 map = new HashMap(); 30 instance = this; 31 } 32 33 public static AceRMIImpl getInstance() 34 { 35 return instance; 36 } 37 38 public String getParam(String object, String param) throws RemoteException 39 { 40 RemoteServiceInterface obj = (RemoteServiceInterface)map.get(object); 41 if (obj != null) 42 { 43 return obj.getRMIParam(param); 44 } 45 return null; 46 } 47 48 public boolean setParam(String object, String param, String value) throws RemoteException 49 { 50 RemoteServiceInterface obj = (RemoteServiceInterface)map.get(object); 51 if (obj != null) 52 { 53 return obj.setRMIParam(param, value); 54 } 55 return false; 56 } 57 58 public void registerService(String name, RemoteServiceInterface obj) 59 { 60 map.put(name, obj); 61 } 62 63 public void unregisterService(String name) 64 { 65 map.remove(name); 66 } 67 } 68 | Popular Tags |