KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > spring > SpringContext


1 package jfun.yan.spring;
2
3
4 import jfun.yan.Component;
5 import jfun.yan.xml.SingletonMode;
6
7 import org.springframework.beans.factory.DisposableBean;
8 import org.springframework.context.ApplicationContext;
9
10 /**
11  * The context containing all the necessary spring information.
12  * <p>
13  * @author Ben Yu
14  * Nov 17, 2005 12:06:13 AM
15  */

16 public interface SpringContext {
17   /**
18    * Get the tag name.
19    */

20   String JavaDoc getTagName();
21   
22   /**
23    * Get the id used to declare this component.
24    */

25   String JavaDoc getId();
26   /**
27    * Get the spring BeanFactory object.
28    */

29   ApplicationContext getApplicationContext();
30   
31   /**
32    * Manage the lifecycle of a Disposable Bean.
33    * @param db the disposable bean.
34    */

35   void manageDisposableBean(DisposableBean db);
36   
37   /**
38    * Notify the framework there is a BeanPostProcessor!
39    * @param key the key of the bean.
40    * @param bpp the component for the BeanPostProcessor.
41    */

42   void addBeanPostProcessor(String JavaDoc key, Component bpp);
43   
44   //String getInitializer();
45
/**
46    * Convert a an object to a target type.
47    * @param target_type the desired type.
48    * @param val the object to be converted.
49    * @return the object of the desired type.
50    */

51   Object JavaDoc convert(Class JavaDoc target_type, Object JavaDoc val);
52   
53   /**
54    * Convert a Component so that it instantiates objects of a certain type.
55    * @param target_type the desired instance type.
56    * @param c the Component to be converted.
57    * @return the new Component object.
58    */

59   Component cast(Class JavaDoc target_type, Component c);
60   
61   /**
62    * Get the configured singleton mode.
63    */

64   SingletonMode getSingleton();
65   
66   /**
67    * Is the singleton mode configured?
68    */

69   boolean isSingletonAttributeSet();
70   
71   /**
72    * Is the tag defined globally?
73    */

74   boolean isGloballyDefined();
75 }
76
Popular Tags