KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ioc > factory > DecorateComponentFactory


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.ioc.factory;
8
9 import org.jfox.ioc.Component;
10 import org.jfox.ioc.ComponentName;
11 import org.jfox.ioc.Registry;
12 import org.jfox.ioc.depend.Dependency;
13 import org.jfox.ioc.exception.ComponentException;
14
15 /**
16  * 修饰器组件Factory,封装默认操作,将所有的操作交给实际的Factory完成
17  *
18  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
19  */

20
21 public abstract class DecorateComponentFactory extends ComponentFactory {
22     protected ComponentFactory delegate;
23
24     public DecorateComponentFactory(ComponentFactory delegate) {
25         this.delegate = delegate;
26     }
27
28     public Component makeComponent() throws ComponentException {
29         return delegate.makeComponent();
30     }
31
32     public ComponentName getComponentName() {
33         return delegate.getComponentName();
34     }
35
36     public Class JavaDoc getImplementation() {
37         return delegate.getImplementation();
38     }
39
40     public Dependency[] getParameters() {
41         return delegate.getParameters();
42     }
43
44     public Registry getRegistry() {
45         return delegate.getRegistry();
46     }
47
48     public void setRegistry(Registry registry) {
49         delegate.setRegistry(registry);
50     }
51
52     public static void main(String JavaDoc[] args) {
53
54     }
55
56 }
57
58
Popular Tags