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