KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > xml > nuts > spring > BeanPostProcessorQueue


1 package jfun.yan.xml.nuts.spring;
2
3 import java.util.ArrayList JavaDoc;
4
5 import jfun.yan.Component;
6
7
8 /**
9  * The queue that collects all components that instantiate BeanPostProcessor objects.
10  * <p>
11  * @author Ben Yu
12  * Nov 20, 2005 5:29:06 PM
13  */

14 public final class BeanPostProcessorQueue {
15   private final ArrayList JavaDoc queue = new ArrayList JavaDoc();
16   private final ArrayList JavaDoc names = new ArrayList JavaDoc();
17   /**
18    * Add a Component that instantiates BeanPostProcessor.
19    * @param name the name of the component.
20    * @param bpp the component.
21    */

22   public void addBeanPostProcessor(String JavaDoc name, Component bpp){
23     names.add(name);
24     queue.add(bpp);
25   }
26   /**
27    * Get the name of a BeanPostProcessor component.
28    * @param i the ordinal position of the component.
29    * @return the name.
30    */

31   public String JavaDoc getName(int i){
32     return (String JavaDoc)names.get(i);
33   }
34   /**
35    * Get a BeanPostProcessor component.
36    * @param i the ordinal position of the component.
37    * @return the name.
38    */

39   public Component getBeanPostProcessor(int i){
40     return (Component)queue.get(i);
41   }
42   /**
43    * To get the number of BeanPostProcessor components stored in the queue.
44    */

45   public int size(){
46     return names.size();
47   }
48 }
49
Popular Tags