01: package com.knowgate.cache.server;
02:
03: import java.beans.*;
04:
05: import java.awt.Image;
06:
07: import java.lang.ClassNotFoundException;
08: import java.lang.NoSuchMethodException;
09:
10: public class DistributedCacheCoordinatorBeanInfo extends SimpleBeanInfo {
11:
12: public DistributedCacheCoordinatorBeanInfo() {
13: }
14:
15: public PropertyDescriptor[] getPropertyDescriptors() {
16: PropertyDescriptor[] pds = new PropertyDescriptor[] {};
17: return pds;
18: }
19:
20: public Image getIcon(int iconKind) {
21: switch (iconKind) {
22: case BeanInfo.ICON_COLOR_16x16:
23: return loadImage("dbbind16c.gif");
24: case BeanInfo.ICON_COLOR_32x32:
25: return loadImage("dbbind32c.gif");
26: case BeanInfo.ICON_MONO_16x16:
27: return loadImage("dbbind16m.gif");
28: case BeanInfo.ICON_MONO_32x32:
29: return loadImage("dbbind32m.gif");
30: }
31: return null;
32: }
33:
34: public MethodDescriptor[] getMethodDescriptors() {
35: try {
36: Class noParams[] = {};
37: Class strParam[] = { Class.forName("String") };
38:
39: MethodDescriptor now = new MethodDescriptor(
40: DistributedCacheCoordinator.class.getMethod("now",
41: noParams));
42: MethodDescriptor lastModified = new MethodDescriptor(
43: DistributedCacheCoordinator.class.getMethod(
44: "lastModified", strParam));
45: MethodDescriptor modify = new MethodDescriptor(
46: DistributedCacheCoordinator.class.getMethod(
47: "modify", strParam));
48: MethodDescriptor expire = new MethodDescriptor(
49: DistributedCacheCoordinator.class.getMethod(
50: "expire", strParam));
51: MethodDescriptor flush = new MethodDescriptor(
52: DistributedCacheCoordinator.class.getMethod(
53: "flush", noParams));
54:
55: MethodDescriptor rv[] = { now, lastModified, modify,
56: expire, flush };
57: return rv;
58: } catch (ClassNotFoundException e) {
59: throw new Error(e.toString());
60: } catch (NoSuchMethodException e) {
61: throw new Error(e.toString());
62: }
63: }
64:
65: private final static Class beanClass = com.knowgate.cache.server.DistributedCacheCoordinator.class;
66:
67: }
|