KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Interface for classes that can be used as nested elements in the
32  * <code>&lt;containers&gt;</code> element of the <code>&lt;cactus&gt;</code>
33  * task.
34  *
35  * @version $Id: Container.java,v 1.13 2004/05/31 20:05:22 vmassol Exp $
36  */

37 public interface Container
38 {
39     // Public Methods ----------------------------------------------------------
40

41     /**
42      * Returns a displayable name of the container for logging purposes.
43      *
44      * @return The container name
45      */

46     String JavaDoc getName();
47
48     /**
49      * Returns the port to which the container should listen.
50      *
51      * @return The port
52      */

53     int getPort();
54
55     /**
56      * @return the context that the webapp will load on, null if the client
57      * should determine on it's own
58      */

59     String JavaDoc getTestContext();
60     
61     /**
62      * @return the time to wait after the container has been started up.
63      */

64     long getStartUpWait();
65     
66     /**
67      * Returns the value of the 'todir' attribute.
68      *
69      * @return The output directory
70      */

71     File JavaDoc getToDir();
72
73     /**
74      * @return the list of system properties that will be set in the container
75      * JVM
76      */

77     Variable[] getSystemProperties();
78     
79     /**
80      * Subclasses should implement this method to perform any initialization
81      * that may be necessary. This method is called before any of the accessors
82      * or the methods {@link AbstractContainer#startUp} and
83      * {@link AbstractContainer#shutDown} are called, but after all attributes
84      * have been set.
85      */

86     void init();
87
88     /**
89      * Returns whether the container element is enabled, which is determined by
90      * the evaluation of the if- and unless conditions
91      *
92      * @return <code>true</code> if the container is enabled
93      */

94     boolean isEnabled();
95
96     /**
97      * Returns whether a specific test case is to be excluded from being run in
98      * the container.
99      *
100      * @param theTestName The fully qualified name of the test fixture class
101      * @return <code>true</code> if the test should be excluded, otherwise
102      * <code>false</code>
103      */

104     boolean isExcluded(String JavaDoc theTestName);
105
106     /**
107      * Sets the factory to use for creating Ant tasks.
108      *
109      * @param theFactory The factory to use for creating Ant tasks
110      */

111     void setAntTaskFactory(AntTaskFactory theFactory);
112
113     /**
114      * Sets the log which the implementation should use.
115      *
116      * @param theLog The log to set
117      */

118     void setLog(Log theLog);
119
120     /**
121      * Sets the file that should be deployed to the container. This can be
122      * either a WAR or an EAR file, depending on the capabilities of the
123      * container.
124      *
125      * @param theDeployableFile The file to deploy
126      */

127     void setDeployableFile(DeployableFile theDeployableFile);
128
129     /**
130      * Sets the system properties that will be passed to the JVM in which the
131      * server will execute.
132      *
133      * @param theProperties the list of system properties to set in the
134      * container JVM
135      */

136     void setSystemProperties(Variable[] theProperties);
137
138     /**
139      * Sets additional classpath entries that will be added to the container
140      * classpath used to start the containers.
141      *
142      * @param theClasspath the container classpath entries to add
143      * @since Cactus 1.6
144      */

145     void setContainerClasspath(Path theClasspath);
146
147     /**
148      * @return additional container classpath entries
149      * @since Cactus 1.6
150      */

151     Path getContainerClasspath();
152     
153     /**
154      * Subclasses must implement this method to perform the actual task of
155      * starting up the container.
156      */

157     void startUp();
158
159     /**
160      * Subclasses must implement this method to perform the actual task of
161      * shutting down the container.
162      */

163     void shutDown();
164 }
165
Popular Tags