KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > monitoring > Monitors


1 package jfun.yan.monitoring;
2
3 import java.beans.IntrospectionException JavaDoc;
4 import java.beans.PropertyDescriptor JavaDoc;
5 import java.lang.reflect.Constructor JavaDoc;
6 import java.lang.reflect.Method JavaDoc;
7
8 import jfun.util.beans.Bean;
9 import jfun.yan.Component;
10 import jfun.yan.Components;
11 import jfun.yan.Functions;
12 import jfun.yan.function.Function;
13 import jfun.yan.util.ReflectionUtil;
14
15 /**
16  * <p>
17  * This class adds monitoring support to constructors, methods and java bean getter/setters.
18  * </p>
19  * @author Michell Lei
20  *
21  */

22 public class Monitors {
23   /**
24    * To adapt a CtorMonitor object to FunctionMonitor object.
25    * @param ctor the Constructor object.
26    * @param mon the CtorMonitor object.
27    * @return the FunctionMonitor object.
28    */

29   public static FunctionMonitor monitor(final Constructor JavaDoc ctor, final CtorMonitor mon){
30       return new FunctionMonitor(){
31       public void calling(Function f, Object JavaDoc[] args){
32         mon.constructing(ctor, args);
33       }
34       public void called(Function f, Object JavaDoc[] args, Object JavaDoc result, long duration){
35         mon.constructed(ctor, args, result, duration);
36       }
37       public void callFailed(Function f, Object JavaDoc[] args, Throwable JavaDoc err, long duration){
38         mon.constructionFailed(ctor, args, err, duration);
39       }
40       };
41   }
42   /**
43    * To adapt a MethodMonitor object to FunctionMonitor object.
44    * @param obj the object that the method is invoked against.
45    * @param mtd the method.
46    * @param mon the MethodMonitor object.
47    * @return the FunctionMonitor object.
48    */

49   public static FunctionMonitor monitor(final Object JavaDoc obj, final Method JavaDoc mtd, final MethodMonitor mon){
50     return new FunctionMonitor(){
51       public void calling(Function f, Object JavaDoc[] args){
52         mon.invoking(obj, mtd, args);
53       }
54       public void called(Function f, Object JavaDoc[] args, Object JavaDoc result, long duration){
55         mon.invoked(obj, mtd, args, result, duration);
56       }
57       public void callFailed(Function f, Object JavaDoc[] args, Throwable JavaDoc err, long duration){
58         mon.invocationFailed(obj, mtd, args, err, duration);
59       }
60     };
61   }
62   /**
63    * To adapt a GetterMonitor object to FunctionMonitor object.
64    * @param obj the object that the getter is invoked against.
65    * @param prop the descriptor of the property.
66    * @param mon the GetterMonitor object.
67    * @return the FunctionMonitor object.
68    */

69   public static FunctionMonitor monitorGetter(final Object JavaDoc obj, final PropertyDescriptor JavaDoc prop, final GetterMonitor mon){
70     return new FunctionMonitor(){
71       public void calling(Function f, Object JavaDoc[] args){
72           mon.propertyGetting(obj, prop);
73       }
74       public void called(Function f, Object JavaDoc[] args, Object JavaDoc result, long duration){
75         mon.propertyGot(obj, prop, result, duration);
76       }
77       public void callFailed(Function f, Object JavaDoc[] args, Throwable JavaDoc err, long duration){
78         mon.propertyGetFailed(obj, prop, err, duration);
79       }
80     };
81   }
82   /**
83    * To adapt an IndexedGetterMonitor object to FunctionMonitor object.
84    * @param obj the object that the getter is invoked against.
85    * @param prop the descriptor of the property.
86    * @param ind the property index.
87    * @param mon the IndexedGetterMonitor object.
88    * @return the FunctionMonitor object.
89    */

90   public static FunctionMonitor monitorGetter(final Object JavaDoc obj, final PropertyDescriptor JavaDoc prop,
91       final int ind, final IndexedGetterMonitor mon){
92     return new FunctionMonitor(){
93       public void calling(Function f, Object JavaDoc[] args){
94         mon.propertyGetting(obj, prop, ind);
95       }
96       public void called(Function f, Object JavaDoc[] args, Object JavaDoc result, long duration){
97         mon.propertyGot(obj, prop, ind, result, duration);
98       }
99       public void callFailed(Function f, Object JavaDoc[] args, Throwable JavaDoc err, long duration){
100         mon.propertyGetFailed(obj, prop, ind, err, duration);
101       }
102     };
103   }
104   private static Object JavaDoc getValue(Object JavaDoc[] args){
105     return args[0];
106   }
107   /**
108    * To adapt a SetterMonitor object to FunctionMonitor object.
109    * @param obj the object that the setter is invoked against.
110    * @param prop the descriptor of the property.
111    * @param mon the SetterMonitor object.
112    * @return the FunctionMonitor object.
113    */

114   public static FunctionMonitor monitorSetter(final Object JavaDoc obj, final PropertyDescriptor JavaDoc prop, final SetterMonitor mon){
115     return new FunctionMonitor(){
116       public void calling(Function f, Object JavaDoc[] args){
117         mon.propertySetting(obj, prop, getValue(args));
118       }
119       public void called(Function f, Object JavaDoc[] args, Object JavaDoc result, long duration){
120         mon.propertySet(obj, prop, getValue(args), duration);
121       }
122       public void callFailed(Function f, Object JavaDoc[] args, Throwable JavaDoc err, long duration){
123         mon.propertySetFailed(obj, prop, getValue(args), err, duration);
124       }
125     };
126   }
127   /**
128    * To adapt an IndexedSetterMonitor object to FunctionMonitor object.
129    * @param obj the object that the setter is invoked against.
130    * @param prop the descriptor of the property.
131    * @param ind the property index.
132    * @param mon the IndexedSetterMonitor object.
133    * @return the FunctionMonitor object.
134    */

135   public static FunctionMonitor monitorSetter(final Object JavaDoc obj, final PropertyDescriptor JavaDoc prop,
136       final int ind, final IndexedSetterMonitor mon){
137     return new FunctionMonitor(){
138       public void calling(Function f, Object JavaDoc[] args){
139         mon.propertySetting(obj, prop, ind, getValue(args));
140       }
141       public void called(Function f, Object JavaDoc[] args, Object JavaDoc result, long duration){
142         mon.propertySet(obj, prop, ind, getValue(args), duration);
143       }
144       public void callFailed(Function f, Object JavaDoc[] args, Throwable JavaDoc err, long duration){
145         mon.propertySetFailed(obj, prop, ind, getValue(args), err, duration);
146       }
147     };
148   }
149
150   /**
151    * Decorate a Function to add monitoring support.
152    * @param f the Function object.
153    * @param mon the FunctionMonitor object.
154    * @return the new Function that supports monitoring.
155    */

156   public static Function fun(Function f, FunctionMonitor mon){
157     return new MonitoredFunction(f, mon);
158   }
159   /**
160    * Create a Function object for a Constructor with monitoring support.
161    * @param ctor the Constructor object.
162    * @param mon the CtorMonitor object.
163    * @return the Function that supports monitoring.
164    */

165   public static Function ctor(Constructor JavaDoc ctor, CtorMonitor mon){
166     return fun(Functions.ctor(ctor), monitor(ctor, mon));
167   }
168   /**
169    * Create a Function object for a Method with monitoring support.
170    * @param self the object to which the method belongs.
171    * @param mtd the Method object.
172    * @param mon the MethodMonitor object.
173    * @return the Function that supports monitoring.
174    */

175   public static Function method(Object JavaDoc self, Method JavaDoc mtd, MethodMonitor mon){
176     return fun(Functions.method(self, mtd), monitor(self, mtd, mon));
177   }
178   /**
179    * Create a Function object for a static Method with monitoring support.
180    * @param mtd the Method object.
181    * @param mon the MethodMonitor object.
182    * @return the Function that supports monitoring.
183    */

184   public static Function static_method(Method JavaDoc mtd, MethodMonitor mon){
185       return fun(Functions.static_method(mtd), monitor(null, mtd, mon));
186   }
187   /**
188    * Create a Function object for a Java Bean property getter with monitoring support.
189    * @param bean the bean.
190    * @param prop_name the property name.
191    * @param mon the GetterMonitor object.
192    * @return the Function that supports monitoring.
193    */

194   public static Function getter(Bean bean, String JavaDoc prop_name, GetterMonitor mon)
195   throws IntrospectionException JavaDoc{
196     final PropertyDescriptor JavaDoc prop = bean.getBeanType().getPropertyDescriptor(prop_name);
197     return fun(Functions.getter(bean, prop_name), monitorGetter(bean.getObject(), prop, mon));
198   }
199   /**
200    * Create a Function object for a Java Bean property setter with monitoring support.
201    * @param bean the bean.
202    * @param prop_name the property name.
203    * @param mon the SetterMonitor object.
204    * @return the Function that supports monitoring.
205    */

206   public static Function setter(Bean bean, String JavaDoc prop_name, SetterMonitor mon)
207   throws IntrospectionException JavaDoc{
208     final PropertyDescriptor JavaDoc prop = bean.getBeanType().getPropertyDescriptor(prop_name);
209     return fun(Functions.setter(bean, prop_name), monitorSetter(bean.getObject(), prop, mon));
210   }
211   /**
212    * Create a Function object for a Java Bean indexed property getter with monitoring support.
213    * @param bean the bean.
214    * @param prop_name the property name.
215    * @param ind the property index.
216    * @param mon the IndexedGetterMonitor object.
217    * @return the Function that supports monitoring.
218    */

219   public static Function getter(Bean bean, String JavaDoc prop_name, int ind, IndexedGetterMonitor mon)
220   throws IntrospectionException JavaDoc{
221     final PropertyDescriptor JavaDoc prop = bean.getBeanType().getPropertyDescriptor(prop_name);
222     return fun(Functions.indexed_getter(bean, prop_name, ind),
223       monitorGetter(bean.getObject(), prop, ind, mon));
224   }
225   /**
226    * Create a Function object for a Java Bean indexed property setter with monitoring support.
227    * @param bean the bean.
228    * @param prop_name the property name.
229    * @param ind the property index.
230    * @param mon the IndexedSetterMonitor object.
231    * @return the Function that supports monitoring.
232    */

233   public static Function setter(Bean bean, String JavaDoc prop_name, int ind, IndexedSetterMonitor mon)
234   throws IntrospectionException JavaDoc{
235     final PropertyDescriptor JavaDoc prop = bean.getBeanType().getPropertyDescriptor(prop_name);
236     return fun(Functions.indexed_setter(bean, prop_name, ind),
237       monitorSetter(bean.getObject(), prop, ind, mon));
238   }
239   private final ComponentMonitor mon;
240   /**
241    * To create a new Monitors object.
242    * @param mon a ComponentMonitor object.
243    */

244   public Monitors(ComponentMonitor mon) {
245     this.mon = mon;
246   }
247   /**
248    * Create a Component for a constructor with monitoring support.
249    * @param ctor the Constructor object.
250    * @return the Component object with monitoring support.
251    */

252   public Component ctor(Constructor JavaDoc ctor){
253     return Components.fun(ctor(ctor, mon));
254   }
255   /**
256    * Create a Component for the constructor specified by the given signature
257    * with monitoring support.
258    * @param type the type for the constructor.
259    * @param param_types the parameter types of the constructor.
260    * @return the Component object with monitoring support.
261    * @throws IllegalArgumentException if no public constructor.
262    */

263   public Component ctor(Class JavaDoc type, Class JavaDoc[] param_types)
264   throws IllegalArgumentException JavaDoc{
265     return ctor(type, param_types, false);
266   }
267   /**
268    * Create a Component for the constructor specified by the given signature
269    * with monitoring support.
270    * @param type the type for the constructor.
271    * @param param_types the parameter types of the constructor.
272    * @param suppress_security whether non-public constructors are searched at all.
273    * @return the Component object with monitoring support.
274    * @throws IllegalArgumentException if no constructor is found.
275    */

276   public Component ctor(Class JavaDoc type, Class JavaDoc[] param_types, boolean suppress_security)
277   throws IllegalArgumentException JavaDoc{
278     final Constructor JavaDoc ctor = ReflectionUtil.getConstructor(type, param_types,
279         suppress_security);
280     return ctor(ctor);
281   }
282   /**
283    * Create a Component for the only public constructor in a class
284    * with monitoring support.
285    * @param type the type for the constructor.
286    * @return the Component object with monitoring support.
287    * @throws IllegalArgumentException if no public constructor is found or more than one are found.
288    */

289   public Component ctor(Class JavaDoc type)
290   throws IllegalArgumentException JavaDoc{
291     return ctor(type, false);
292   }
293   /**
294    * Create a Component for the only public constructor in a class
295    * with monitoring support.
296    * @param type the type for the constructor.
297    * @param suppress_security whether non-public constructors are searched at all.
298    * @return the Component object with monitoring support.
299    * @throws IllegalArgumentException if no constructor is found or more than one are found.
300    */

301   public Component ctor(Class JavaDoc type, boolean suppress_security)
302   throws IllegalArgumentException JavaDoc{
303     final Constructor JavaDoc ctor = ReflectionUtil.getConstructor(type, suppress_security);
304     return ctor(ctor);
305   }
306   /**
307    * Create a Component for a method with monitoring support.
308    * @param obj the 'this' object to invoke the method against.
309    * @param mtd the method object.
310    * @return the Component object with monitoring support.
311    */

312   public Component method(Object JavaDoc obj, Method JavaDoc mtd){
313     return Components.fun(method(obj, mtd, mon));
314   }
315   /**
316    * Create a Component for a method specified by the given signature with monitoring support.
317    * @param type the type to search method.
318    * @param obj the 'this' object to invoke the method against.
319    * @param name the method name.
320    * @param param_types the parameter types of the method.
321    * @return the Component object with monitoring support.
322    * @throws IllegalArgumentException if the method is not found.
323    */

324   public Component method(Class JavaDoc type, Object JavaDoc obj, String JavaDoc name, Class JavaDoc[] param_types)
325   throws IllegalArgumentException JavaDoc{
326     return method(type, obj, name, param_types, false);
327   }
328   /**
329    * Create a Component for a method specified by the given signature with monitoring support.
330    * @param type the type to search method.
331    * @param obj the 'this' object to invoke the method against.
332    * @param name the method name.
333    * @param param_types the parameter types of the method.
334    * @param suppress_security whether non-public methods are searched at all.
335    * @return the Component object with monitoring support.
336    * @throws IllegalArgumentException if the method is not found.
337    */

338   public Component method(Class JavaDoc type, Object JavaDoc obj, String JavaDoc name, Class JavaDoc[] param_types,
339       boolean suppress_security)
340   throws IllegalArgumentException JavaDoc{
341     return method(obj, ReflectionUtil.getMethod(type, name, param_types, suppress_security));
342   }
343   /**
344    * Create a Component for a method specified by name with monitoring support.
345    * @param type the type to search method.
346    * @param obj the 'this' object to invoke the method against.
347    * @param name the method name.
348    * @return the Component object with monitoring support.
349    * @throws IllegalArgumentException if no public method with this name is found or more than one are found.
350    */

351   public Component method(Class JavaDoc type, Object JavaDoc obj, String JavaDoc name)
352   throws IllegalArgumentException JavaDoc{
353     return method(type, obj, name, false);
354   }
355   /**
356    * Create a Component for a method specified by name with monitoring support.
357    * @param type the type to search method.
358    * @param obj the 'this' object to invoke the method against.
359    * @param name the method name.
360    * @param suppress_security whether non-public methods are searched at all.
361    * @return the Component object with monitoring support.
362    * @throws IllegalArgumentException if no method with this name is found or more than one are found.
363    */

364   public Component method(Class JavaDoc type, Object JavaDoc obj, String JavaDoc name, boolean suppress_security)
365   throws IllegalArgumentException JavaDoc{
366     return method(obj, ReflectionUtil.getMethod(type, name, suppress_security));
367   }
368   /**
369    * Create a Component for a static method with monitoring support.
370    * @param mtd the method object.
371    * @return the Component object with monitoring support.
372    * @throws IllegalArgumentException if the method is not static.
373    */

374   public Component static_method(Method JavaDoc mtd)
375   throws IllegalArgumentException JavaDoc{
376     return Components.fun(static_method(mtd, mon));
377   }
378   /**
379    * Create a Component for a static method specified by the given signature with monitoring support.
380    * @param type the type to search method.
381    * @param name the method name.
382    * @param param_types the parameter types of the method.
383    * @return the Component object with monitoring support.
384    * @throws IllegalArgumentException if the static method is not found.
385    */

386   public Component static_method(Class JavaDoc type, String JavaDoc name, Class JavaDoc[] param_types)
387   throws IllegalArgumentException JavaDoc{
388     return static_method(type, name, param_types, false);
389   }
390   /**
391    * Create a Component for a static method specified by the given signature with monitoring support.
392    * @param type the type to search method.
393    * @param name the method name.
394    * @param param_types the parameter types of the method.
395    * @param suppress_security whether non-public methods are searched at all.
396    * @return the Component object with monitoring support.
397    * @throws IllegalArgumentException if the static method is not found.
398    */

399   public Component static_method(Class JavaDoc type, String JavaDoc name, Class JavaDoc[] param_types,
400       boolean suppress_security)
401   throws IllegalArgumentException JavaDoc{
402     return static_method(ReflectionUtil.getMethod(type, name, param_types,
403         suppress_security));
404   }
405   /**
406    * Create a Component for a static method specified by name with monitoring support.
407    * @param type the type to search method.
408    * @param name the method name.
409    * @return the Component object with monitoring support.
410    * @throws IllegalArgumentException if no public static method with this name is found or more than one are found.
411    */

412   public Component static_method(Class JavaDoc type, String JavaDoc name)
413   throws IllegalArgumentException JavaDoc{
414     return static_method(type, name, false);
415   }
416   /**
417    * Create a Component for a static method specified by name with monitoring support.
418    * @param type the type to search method.
419    * @param name the method name.
420    * @param suppress_security whether non-public methods are searched at all.
421    * @return the Component object with monitoring support.
422    * @throws IllegalArgumentException if no static method with this name is found or more than one are found.
423    */

424   public Component static_method(Class JavaDoc type, String JavaDoc name, boolean suppress_security)
425   throws IllegalArgumentException JavaDoc{
426     return static_method(ReflectionUtil.getStaticMethod(type, name, suppress_security));
427   }
428   /**
429    * Create a Component for a method specified by the given signature with monitoring support.
430    * @param obj the 'this' object to invoke the method against.
431    * @param name the method name.
432    * @param param_types the parameter types of the method.
433    * @return the Component object with monitoring support.
434    * @throws IllegalArgumentException if the method is not found.
435    */

436   public Component method(Object JavaDoc obj, String JavaDoc name, Class JavaDoc[] param_types)
437   throws IllegalArgumentException JavaDoc{
438     return method(obj, name, param_types, false);
439   }
440   /**
441    * Create a Component for a method specified by the given signature with monitoring support.
442    * @param obj the 'this' object to invoke the method against.
443    * @param name the method name.
444    * @param param_types the parameter types of the method.
445    * @param suppress_security whether non-public methods are searched at all.
446    * @return the Component object with monitoring support.
447    * @throws IllegalArgumentException if the method is not found.
448    */

449   public Component method(Object JavaDoc obj, String JavaDoc name, Class JavaDoc[] param_types,
450       boolean suppress_security)
451   throws IllegalArgumentException JavaDoc{
452     return method(obj, ReflectionUtil.getMethod(obj.getClass(), name, param_types,
453         suppress_security));
454   }
455   /**
456    * Create a Component for a method specified by name with monitoring support.
457    * @param obj the 'this' object to invoke the method against.
458    * @param name the method name.
459    * @return the Component object with monitoring support.
460    * @throws IllegalArgumentException if no public method with this name is found or more than one are found.
461    */

462   public Component method(Object JavaDoc obj, String JavaDoc name)
463   throws IllegalArgumentException JavaDoc{
464     return method(obj, name, false);
465   }
466   /**
467    * Create a Component for a method specified by name with monitoring support.
468    * @param obj the 'this' object to invoke the method against.
469    * @param name the method name.
470    * @param suppress_security whether non-public methods are searched at all.
471    * @return the Component object with monitoring support.
472    * @throws IllegalArgumentException if no method with this name is found or more than one are found.
473    */

474   public Component method(Object JavaDoc obj, String JavaDoc name, boolean suppress_security)
475   throws IllegalArgumentException JavaDoc{
476     return method(obj, ReflectionUtil.getMethod(obj.getClass(), name,
477         suppress_security));
478   }
479   /**
480    * Create a Component for a Java Bean property getter with monitoring support.
481    * @param bean the bean.
482    * @param prop_name the property name.
483    * @return the Component object with monitoring support.
484    * @throws IntrospectionException when introspection error happends.
485    */

486   public Component getter(Bean bean, String JavaDoc prop_name)
487   throws IntrospectionException JavaDoc{
488     return Components.fun(getter(bean, prop_name, mon));
489   }
490   /**
491    * Create a Component for a Java Bean property setter with monitoring support.
492    * @param bean the bean.
493    * @param prop_name the property name.
494    * @return the Component object with monitoring support.
495    * @throws IntrospectionException when introspection error happends.
496    */

497   public Component setter(Bean bean, String JavaDoc prop_name)
498   throws IntrospectionException JavaDoc{
499     return Components.fun(setter(bean, prop_name, mon));
500   }
501   /**
502    * Create a Component for a Java Bean indexed property getter with monitoring support.
503    * @param bean the bean.
504    * @param prop_name the property name.
505    * @param ind the property index.
506    * @return the Component object with monitoring support.
507    * @throws IntrospectionException when introspection error happends.
508    */

509   public Component getter(Bean bean, String JavaDoc prop_name, int ind)
510   throws IntrospectionException JavaDoc{
511     return Components.fun(getter(bean, prop_name, ind, mon));
512   }
513   /**
514    * Create a Component for a Java Bean indexed property setter with monitoring support.
515    * @param bean the bean.
516    * @param prop_name the property name.
517    * @param ind the property index.
518    * @return the Component object with monitoring support.
519    * @throws IntrospectionException when introspection error happends.
520    */

521   public Component setter(Bean bean, String JavaDoc prop_name, int ind)
522   throws IntrospectionException JavaDoc{
523     return Components.fun(setter(bean, prop_name, ind, mon));
524   }
525   /**
526    * Create a Component for a Java Bean property getter with monitoring support.
527    * @param type the type to search the property.
528    * @param obj the object to invoke the getter against.
529    * @param prop_name the property name.
530    * @return the Component object with monitoring support.
531    * @throws IntrospectionException when introspection error happends.
532    */

533   public Component getter(Class JavaDoc type, Object JavaDoc obj, String JavaDoc prop_name)
534   throws IntrospectionException JavaDoc{
535     return getter(Bean.instance(type, obj), prop_name);
536   }
537   /**
538    * Create a Component for a Java Bean property setter with monitoring support.
539    * @param type the type to search the property.
540    * @param obj the object to invoke the setter against.
541    * @param prop_name the property name.
542    * @return the Component object with monitoring support.
543    * @throws IntrospectionException when introspection error happends.
544    */

545   public Component setter(Class JavaDoc type, Object JavaDoc obj, String JavaDoc prop_name)
546   throws IntrospectionException JavaDoc{
547     return setter(Bean.instance(type, obj), prop_name);
548   }
549   /**
550    * Create a Component for a Java Bean indexed property getter with monitoring support.
551    * @param type the type to search the property.
552    * @param obj the object to invoke the getter against.
553    * @param prop_name the property name.
554    * @param ind the property index.
555    * @return the Component object with monitoring support.
556    * @throws IntrospectionException when introspection error happends.
557    */

558   public Component getter(Class JavaDoc type, Object JavaDoc obj, String JavaDoc prop_name, int ind)
559   throws IntrospectionException JavaDoc{
560     return getter(Bean.instance(type, obj), prop_name, ind);
561   }
562   /**
563    * Create a Component for a Java Bean indexed property setter with monitoring support.
564    * @param type the type to search the property.
565    * @param obj the object to invoke the setter against.
566    * @param prop_name the property name.
567    * @param ind the property index.
568    * @return the Component object with monitoring support.
569    * @throws IntrospectionException when introspection error happends.
570    */

571   public Component setter(Class JavaDoc type, Object JavaDoc obj, String JavaDoc prop_name, int ind)
572   throws IntrospectionException JavaDoc{
573     return setter(Bean.instance(type, obj), prop_name, ind);
574   }
575   /**
576    * Create a Component for a Java Bean property getter with monitoring support.
577    * @param obj the object to invoke the getter against.
578    * @param prop_name the property name.
579    * @return the Component object with monitoring support.
580    * @throws IntrospectionException when introspection error happends.
581    */

582   public Component getter(Object JavaDoc obj, String JavaDoc prop_name)
583   throws IntrospectionException JavaDoc{
584     return getter(obj.getClass(), obj, prop_name);
585   }
586   /**
587    * Create a Component for a Java Bean property setter with monitoring support.
588    * @param obj the object to invoke the setter against.
589    * @param prop_name the property name.
590    * @return the Component object with monitoring support.
591    * @throws IntrospectionException when introspection error happends.
592    */

593   public Component setter(Object JavaDoc obj, String JavaDoc prop_name)
594   throws IntrospectionException JavaDoc{
595     return setter(obj.getClass(), obj, prop_name);
596   }
597   /**
598    * Create a Component for a Java Bean indexed property getter with monitoring support.
599    * @param obj the object to invoke the getter against.
600    * @param prop_name the property name.
601    * @param ind the property index.
602    * @return the Component object with monitoring support.
603    * @throws IntrospectionException when introspection error happends.
604    */

605   public Component getter(Object JavaDoc obj, String JavaDoc prop_name, int ind)
606   throws IntrospectionException JavaDoc{
607     return getter(obj.getClass(), obj, prop_name, ind);
608   }
609   /**
610    * Create a Component for a Java Bean indexed property setter with monitoring support.
611    * @param obj the object to invoke the setter against.
612    * @param prop_name the property name.
613    * @param ind the property index.
614    * @return the Component object with monitoring support.
615    * @throws IntrospectionException when introspection error happends.
616    */

617   public Component setter(Object JavaDoc obj, String JavaDoc prop_name, int ind)
618   throws IntrospectionException JavaDoc{
619     return setter(obj.getClass(), obj, prop_name, ind);
620   }
621 }
622
Popular Tags