KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > client > raccess > AceRMIImpl


1 /*
2  * HTTPSRemoteService.java
3  *
4  * Created on May 26, 2003, 12:21 PM
5  */

6
7 package com.quikj.client.raccess;
8
9 import java.util.*;
10 import java.rmi.*;
11 import java.rmi.server.*;
12 /**
13  *
14  * @author amit
15  */

16
17
18 public class AceRMIImpl extends UnicastRemoteObject implements AceRMIInterface
19 {
20     private HashMap map;
21     private static AceRMIImpl instance = null;
22     
23     /** Creates a new instance of HTTPSRemoteService */
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 JavaDoc getParam(String JavaDoc object, String JavaDoc 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 JavaDoc object, String JavaDoc param, String JavaDoc 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 JavaDoc name, RemoteServiceInterface obj)
59     {
60         map.put(name, obj);
61     }
62     
63     public void unregisterService(String JavaDoc name)
64     {
65         map.remove(name);
66     }
67 }
68
Popular Tags