KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cactus > integration > ant > container > ContainerWrapper


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

20 package org.apache.cactus.integration.ant.container;
21
22 import java.io.File JavaDoc;
23
24 import org.apache.cactus.integration.ant.deployment.DeployableFile;
25 import org.apache.cactus.integration.ant.util.AntTaskFactory;
26 import org.apache.commons.logging.Log;
27 import org.apache.tools.ant.types.Path;
28 import org.apache.tools.ant.types.Environment.Variable;
29
30 /**
31  * Class that wraps around an implementation of the <code>Container</code>
32  * interface and delegates all calls to the wrapped instance.
33  *
34  * @version $Id: ContainerWrapper.java,v 1.14 2004/05/31 20:05:22 vmassol Exp $
35  */

36 public class ContainerWrapper implements Container
37 {
38
39     // Instance Variables ------------------------------------------------------
40

41     /**
42      * The nested container.
43      */

44     private Container container;
45
46     // Constructors ------------------------------------------------------------
47

48     /**
49      * Constructor.
50      *
51      * @param theContainer The container to wrap
52      */

53     public ContainerWrapper(Container theContainer)
54     {
55         if (theContainer == null)
56         {
57             throw new NullPointerException JavaDoc("'theContainer' must not be null");
58         }
59         this.container = theContainer;
60     }
61
62     // AbstractContainer Implementation ----------------------------------------
63

64     /**
65      * @see Container#getName()
66      */

67     public String JavaDoc getName()
68     {
69         return container.getName();
70     }
71     
72     /**
73      * @see Container#getTestContext()
74      */

75     public String JavaDoc getTestContext()
76     {
77         return this.container.getTestContext();
78     }
79     
80     /**
81      * @see Container#getStartUpWait()
82      */

83     public long getStartUpWait()
84     {
85         return container.getStartUpWait();
86     }
87     
88     /**
89      * @see Container#getPort()
90      */

91     public int getPort()
92     {
93         return this.container.getPort();
94     }
95
96     /**
97      * @see Container#getToDir()
98      */

99     public File JavaDoc getToDir()
100     {
101         return this.container.getToDir();
102     }
103
104     /**
105      * @see Container#getSystemProperties()
106      */

107     public Variable[] getSystemProperties()
108     {
109         return this.container.getSystemProperties();
110     }
111     
112     /**
113      * @see Container#init()
114      */

115     public void init()
116     {
117         this.container.init();
118     }
119
120     /**
121      * @see Container#isEnabled()
122      */

123     public boolean isEnabled()
124     {
125         return this.container.isEnabled();
126     }
127
128     /**
129      * @see Container#isExcluded(String)
130      */

131     public boolean isExcluded(String JavaDoc theTestName)
132     {
133         return this.container.isExcluded(theTestName);
134     }
135
136     /**
137      * @see Container#startUp()
138      */

139     public void startUp()
140     {
141         this.container.startUp();
142     }
143
144     /**
145      * @see Container#shutDown()
146      */

147     public void shutDown()
148     {
149         this.container.shutDown();
150     }
151     
152     /**
153      * @see Container#setAntTaskFactory(AntTaskFactory)
154      */

155     public void setAntTaskFactory(AntTaskFactory theFactory)
156     {
157         this.container.setAntTaskFactory(theFactory);
158     }
159
160     /**
161      * @see Container#setLog(Log)
162      */

163     public void setLog(Log theLog)
164     {
165         this.container.setLog(theLog);
166     }
167
168     /**
169      * @see Container#setDeployableFile(DeployableFile)
170      */

171     public void setDeployableFile(DeployableFile theWarFile)
172     {
173         this.container.setDeployableFile(theWarFile);
174     }
175
176     /**
177      * @see Container#setSystemProperties
178      */

179     public void setSystemProperties(Variable[] theProperties)
180     {
181         this.container.setSystemProperties(theProperties);
182     }
183
184     /**
185      * @see Container#setContainerClasspath(Path)
186      * @since Cactus 1.6
187      */

188     public void setContainerClasspath(Path theClasspath)
189     {
190         this.container.setContainerClasspath(theClasspath);
191     }
192
193     /**
194      * @see Container#getContainerClasspath()
195      * @since Cactus 1.6
196      */

197     public Path getContainerClasspath()
198     {
199         return this.container.getContainerClasspath();
200     }
201 }
202
Popular Tags