1 /*
2 * ========================================================================
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership.
7 * The ASF licenses this file to You under the Apache License, Version 2.0
8 * (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * ========================================================================
20 */
21 package org.apache.cactus.integration.api.deployable;
22
23 import java.io.File;
24
25 import org.codehaus.cargo.module.webapp.WarArchive;
26
27
28 /**
29 * Represents a component to deploy in a container. It can either be
30 * a WAR or an EAR file.
31 *
32 * @version $Id: DeployableFile.java 239003 2004-05-31 20:05:27Z vmassol $
33 */
34 public interface DeployableFile
35 {
36 /**
37 * @return the file to deploy in a container (either WAR or EAR)
38 */
39 File getFile();
40
41 /**
42 * Returns whether the deployable file is a web-app archive (WAR).
43 *
44 * @return <code>true</code> if the deployable file is a WAR
45 */
46 boolean isWar();
47
48 /**
49 * Returns whether the deployable file is an enterprise application archive
50 * (EAR).
51 *
52 * @return <code>true</code> if the deployable file is a EAR
53 */
54 boolean isEar();
55
56 /**
57 * @return the WAR deployment descriptor object for the WAR containing
58 * the Cactus Servlet redirector
59 */
60 WarArchive getWarArchive();
61
62 /**
63 * @return the webapp context which holds the Cactus tests
64 */
65 String getTestContext();
66
67 /**
68 * @param theTestContext the test context that will be used to test if the
69 * container is started or not
70 */
71 void setTestContext(String theTestContext);
72
73 /**
74 * Returns the first URL-pattern to which the Cactus servlet redirector is
75 * mapped in the deployment descriptor.
76 *
77 * @return The mapping, or <code>null</code> if the servlet redirector is
78 * not defined or mapped in the descriptor
79 */
80 String getServletRedirectorMapping();
81
82 /**
83 * Returns the first URL-pattern to which the Cactus filter redirector is
84 * mapped in the deployment descriptor.
85 *
86 * @return The mapping, or <code>null</code> if the filter redirector is
87 * not defined or mapped in the descriptor
88 */
89 String getFilterRedirectorMapping();
90
91 /**
92 * Returns the first URL-pattern to which the Cactus JSP redirector is
93 * mapped in the deployment descriptor.
94 *
95 * @return The mapping, or <code>null</code> if the JSP redirector is
96 * not defined or mapped in the descriptor
97 */
98 String getJspRedirectorMapping();
99
100 /**
101 * Clone the object.
102 * @return the object clone
103 * @throws CloneNotSupportedException If clone is not supported (duh)
104 */
105 Object clone() throws CloneNotSupportedException;
106 }