KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jdon > container > ContainerWrapper


1 /**
2  * Copyright 2003-2005 the original author or authors.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6
7        http://www.apache.org/licenses/LICENSE-2.0
8
9   * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */

15
16 package com.jdon.container;
17
18 import java.util.List JavaDoc;
19
20 import com.jdon.aop.interceptor.InterceptorsChain;
21 import com.jdon.container.visitor.ComponentVisitor;
22 import com.jdon.controller.cache.InstanceCache;
23
24 /**
25  * ContainerWrapper is main interface of jdonframework
26  *
27  * @author banq
28  */

29 public interface ContainerWrapper {
30
31   /**
32    * register a component class
33    * @param name component name
34    * @param className component class
35    */

36   public void register(String JavaDoc name, Class JavaDoc className);
37
38   /**
39    * register a component class with construtors of String type
40    * @param name component name
41    * @param className component class
42    * @param constructors component construtor parameters
43    */

44   public void register(String JavaDoc name, Class JavaDoc className, String JavaDoc[] constructors);
45
46   /**
47    * register a component instance
48    * @param name component name
49    * @param instance component instance
50    */

51   public void register(String JavaDoc name, Object JavaDoc instance);
52   
53   /**
54    * register a component, its class value is its name value
55    *
56    * @param name the name must be a class string
57    */

58   public void register(String JavaDoc name);
59
60   /**
61    * start the container
62    * this method will active all components's startup methods in container,
63    *
64    */

65   public void start();
66
67   /**
68    * stop the container
69    * this method will active all components's stop methods in container.
70    *
71    */

72   public void stop();
73
74   /**
75    * return all instances
76    * @return all instances collection in container
77    */

78   public List JavaDoc getAllInstances();
79
80   /**
81    * get a component instance from container
82    * @param name component name
83    * @return component single instance
84    */

85   public Object JavaDoc lookup(String JavaDoc name);
86   
87   /**
88    * when access this method, will return a new component instance
89    * it is difference with lookup method
90    * @param name
91    * @return a new component instance
92    */

93   public Object JavaDoc getComponentNewInstance(String JavaDoc name);
94   
95   /**
96    * return a component class from container
97    * @param name
98    * @return component Class
99    */

100   public Class JavaDoc getComponentClass(String JavaDoc name);
101
102   /**
103    * register a child container
104    * @param name
105    */

106   public void registerChild(String JavaDoc name);
107   
108   /**
109    * get the child container
110    * @param name
111    * @return container
112    */

113   public ContainerWrapper getChild(String JavaDoc name);
114     
115
116 }
117
Popular Tags