|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ContainerWrapper.java | 50% | 23.5% | 20% | 23.5% |
|
1 |
/*
|
|
2 |
* ====================================================================
|
|
3 |
*
|
|
4 |
* The Apache Software License, Version 1.1
|
|
5 |
*
|
|
6 |
* Copyright (c) 2003 The Apache Software Foundation. All rights
|
|
7 |
* reserved.
|
|
8 |
*
|
|
9 |
* Redistribution and use in source and binary forms, with or without
|
|
10 |
* modification, are permitted provided that the following conditions
|
|
11 |
* are met:
|
|
12 |
*
|
|
13 |
* 1. Redistributions of source code must retain the above copyright
|
|
14 |
* notice, this list of conditions and the following disclaimer.
|
|
15 |
*
|
|
16 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
17 |
* notice, this list of conditions and the following disclaimer in
|
|
18 |
* the documentation and/or other materials provided with the
|
|
19 |
* distribution.
|
|
20 |
*
|
|
21 |
* 3. The end-user documentation included with the redistribution, if
|
|
22 |
* any, must include the following acknowlegement:
|
|
23 |
* "This product includes software developed by the
|
|
24 |
* Apache Software Foundation (http://www.apache.org/)."
|
|
25 |
* Alternately, this acknowlegement may appear in the software itself,
|
|
26 |
* if and wherever such third-party acknowlegements normally appear.
|
|
27 |
*
|
|
28 |
* 4. The names "The Jakarta Project", "Cactus" and "Apache Software
|
|
29 |
* Foundation" must not be used to endorse or promote products
|
|
30 |
* derived from this software without prior written permission. For
|
|
31 |
* written permission, please contact apache@apache.org.
|
|
32 |
*
|
|
33 |
* 5. Products derived from this software may not be called "Apache"
|
|
34 |
* nor may "Apache" appear in their names without prior written
|
|
35 |
* permission of the Apache Group.
|
|
36 |
*
|
|
37 |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
38 |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
39 |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
40 |
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
|
41 |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
42 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
43 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
44 |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
45 |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
46 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
47 |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
48 |
* SUCH DAMAGE.
|
|
49 |
* ====================================================================
|
|
50 |
*
|
|
51 |
* This software consists of voluntary contributions made by many
|
|
52 |
* individuals on behalf of the Apache Software Foundation. For more
|
|
53 |
* information on the Apache Software Foundation, please see
|
|
54 |
* <http://www.apache.org/>.
|
|
55 |
*
|
|
56 |
*/
|
|
57 |
package org.apache.cactus.integration.ant.container;
|
|
58 |
|
|
59 |
import java.io.File;
|
|
60 |
|
|
61 |
import org.apache.cactus.integration.ant.util.AntTaskFactory;
|
|
62 |
import org.apache.commons.logging.Log;
|
|
63 |
import org.apache.tools.ant.types.Environment.Variable;
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Class that wraps around an implementation of the <code>Container</code>
|
|
67 |
* interface and delegates all calls to the wrapped instance.
|
|
68 |
*
|
|
69 |
* @author <a href="mailto:cmlenz@apache.org">Christopher Lenz</a>
|
|
70 |
*
|
|
71 |
* @version $Id: ContainerWrapper.java,v 1.5.2.2 2003/10/23 18:20:43 vmassol Exp $
|
|
72 |
*/
|
|
73 |
public class ContainerWrapper implements Container |
|
74 |
{ |
|
75 |
|
|
76 |
// Instance Variables ------------------------------------------------------
|
|
77 |
|
|
78 |
/**
|
|
79 |
* The nested container.
|
|
80 |
*/
|
|
81 |
private Container container;
|
|
82 |
|
|
83 |
// Constructors ------------------------------------------------------------
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Constructor.
|
|
87 |
*
|
|
88 |
* @param theContainer The container to wrap
|
|
89 |
*/
|
|
90 | 2 |
public ContainerWrapper(Container theContainer)
|
91 |
{ |
|
92 | 2 |
if (theContainer == null) |
93 |
{ |
|
94 | 0 |
throw new NullPointerException("'theContainer' must not be null"); |
95 |
} |
|
96 | 2 |
this.container = theContainer;
|
97 |
} |
|
98 |
|
|
99 |
// AbstractContainer Implementation ----------------------------------------
|
|
100 |
|
|
101 |
/**
|
|
102 |
* @see Container#getName
|
|
103 |
*/
|
|
104 | 0 |
public String getName()
|
105 |
{ |
|
106 | 0 |
return container.getName();
|
107 |
} |
|
108 |
|
|
109 |
/**
|
|
110 |
* @see Container#getStartUpWait()
|
|
111 |
*/
|
|
112 | 0 |
public long getStartUpWait() |
113 |
{ |
|
114 | 0 |
return container.getStartUpWait();
|
115 |
} |
|
116 |
|
|
117 |
/**
|
|
118 |
* @see Container#getPort
|
|
119 |
*/
|
|
120 | 0 |
public int getPort() |
121 |
{ |
|
122 | 0 |
return this.container.getPort(); |
123 |
} |
|
124 |
|
|
125 |
/**
|
|
126 |
* @see Container#getToDir
|
|
127 |
*/
|
|
128 | 0 |
public File getToDir()
|
129 |
{ |
|
130 | 0 |
return this.container.getToDir(); |
131 |
} |
|
132 |
|
|
133 |
/**
|
|
134 |
* @see Container#getSystemProperties
|
|
135 |
*/
|
|
136 | 0 |
public Variable[] getSystemProperties()
|
137 |
{ |
|
138 | 0 |
return this.container.getSystemProperties(); |
139 |
} |
|
140 |
|
|
141 |
/**
|
|
142 |
* @see Container#init
|
|
143 |
*/
|
|
144 | 0 |
public void init() |
145 |
{ |
|
146 | 0 |
this.container.init();
|
147 |
} |
|
148 |
|
|
149 |
/**
|
|
150 |
* @see Container#isEnabled
|
|
151 |
*/
|
|
152 | 0 |
public boolean isEnabled() |
153 |
{ |
|
154 | 0 |
return this.container.isEnabled(); |
155 |
} |
|
156 |
|
|
157 |
/**
|
|
158 |
* @see Container#isExcluded
|
|
159 |
*/
|
|
160 | 0 |
public boolean isExcluded(String theTestName) |
161 |
{ |
|
162 | 0 |
return this.container.isExcluded(theTestName); |
163 |
} |
|
164 |
|
|
165 |
/**
|
|
166 |
* @see Container#startUp
|
|
167 |
*/
|
|
168 | 1 |
public void startUp() |
169 |
{ |
|
170 | 1 |
this.container.startUp();
|
171 |
} |
|
172 |
|
|
173 |
/**
|
|
174 |
* @see Container#shutDown
|
|
175 |
*/
|
|
176 | 1 |
public void shutDown() |
177 |
{ |
|
178 | 1 |
this.container.shutDown();
|
179 |
} |
|
180 |
|
|
181 |
/**
|
|
182 |
* @see Container#setAntTaskFactory
|
|
183 |
*/
|
|
184 | 0 |
public void setAntTaskFactory(AntTaskFactory theFactory) |
185 |
{ |
|
186 | 0 |
this.container.setAntTaskFactory(theFactory);
|
187 |
} |
|
188 |
|
|
189 |
/**
|
|
190 |
* @see Container#setLog
|
|
191 |
*/
|
|
192 | 0 |
public void setLog(Log theLog) |
193 |
{ |
|
194 | 0 |
this.container.setLog(theLog);
|
195 |
} |
|
196 |
|
|
197 |
/**
|
|
198 |
* @see Container#setDeployableFile
|
|
199 |
*/
|
|
200 | 0 |
public void setDeployableFile(DeployableFile theWarFile) |
201 |
{ |
|
202 | 0 |
this.container.setDeployableFile(theWarFile);
|
203 |
} |
|
204 |
|
|
205 |
/**
|
|
206 |
* @see Container#setSystemProperties
|
|
207 |
*/
|
|
208 | 0 |
public void setSystemProperties(Variable[] theProperties) |
209 |
{ |
|
210 | 0 |
this.container.setSystemProperties(theProperties);
|
211 |
} |
|
212 |
} |
|
213 |
|
|