01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: *
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * @author Victor A. Martynov
21: * @version $Revision: 1.1.2.3 $
22: */package org.apache.harmony.rmi.activation;
23:
24: import java.lang.reflect.Field;
25: import java.lang.reflect.Method;
26:
27: import java.rmi.NotBoundException;
28: import java.rmi.Remote;
29: import java.rmi.RemoteException;
30: import java.rmi.activation.ActivationGroupID;
31: import java.rmi.activation.ActivationID;
32: import java.rmi.registry.LocateRegistry;
33: import java.rmi.registry.Registry;
34:
35: import java.util.Hashtable;
36:
37: /**
38: * The parent class for all RMID monitors.
39: *
40: * @author Victor A. Martynov
41: * @version $Revision: 1.1.2.3 $
42: */
43: public class RmidMonitorAdapter implements RmidMonitor {
44:
45: public Hashtable probeRegistry(int port) throws RemoteException,
46: NotBoundException {
47: Hashtable table = new Hashtable();
48: Registry r = LocateRegistry.getRegistry(port);
49: String s[] = r.list();
50:
51: for (int i = 0; i < s.length; i++) {
52: Remote robj = r.lookup(s[i]);
53: Class cl = robj.getClass();
54: Field f[] = cl.getDeclaredFields();
55: Method m[] = cl.getDeclaredMethods();
56: Object buf[] = new Object[2];
57:
58: buf[0] = f;
59: buf[1] = m;
60: table.put(robj, buf);
61: }
62:
63: return table;
64: }
65:
66: public void setStartMonitor(boolean startMonitor) {
67: }
68:
69: public void addGroup(ActivationGroupID gID) {
70: }
71:
72: public void activeGroup(ActivationGroupID gID) {
73: }
74:
75: public void inactiveGroup(ActivationGroupID gID) {
76: }
77:
78: public void removeGroup(ActivationGroupID gID) {
79: }
80:
81: public void addObject(ActivationID oID, ActivationGroupID gID) {
82: }
83:
84: public void activeObject(ActivationID oID) {
85: }
86:
87: public void inactiveObject(ActivationID oID) {
88: }
89:
90: public void removeObject(ActivationID oID) {
91: }
92: }
|