001: /*
002: * ========================================================================
003: *
004: * Copyright 2003-2004 The Apache Software Foundation.
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: *
018: * ========================================================================
019: */
020: package org.apache.cactus.integration.ant.deployment;
021:
022: import java.io.File;
023:
024: import org.apache.cactus.integration.ant.deployment.webapp.WarArchive;
025:
026: /**
027: * Logic common to all deployable implementations (WAR and EAR
028: * deployments).
029: *
030: * @since Cactus 1.5
031: * @version $Id: AbstractDeployableFile.java 239003 2004-05-31 20:05:27Z vmassol $
032: */
033: public abstract class AbstractDeployableFile implements DeployableFile,
034: Cloneable {
035: /**
036: * The WAR or EAR file to deploy.
037: */
038: protected File deployableFile;
039:
040: /**
041: * WAR deployment descriptor as a java object. In case of an EAR,
042: * it is the first WAR containing the Cactus Servlet redirector.
043: */
044: protected WarArchive warArchive;
045:
046: /**
047: * Webapp context path containing the Cactus tests
048: */
049: protected String testContext;
050:
051: /**
052: * Servlet mapping of the Cactus Servlet redirector found
053: * in the warArchive WAR.
054: */
055: protected String servletRedirectorMapping;
056:
057: /**
058: * Filter mapping of the Cactus Filter redirector found
059: * in the warArchive WAR.
060: */
061: protected String filterRedirectorMapping;
062:
063: /**
064: * JSP mapping of the Cactus JSP redirector found
065: * in the warArchive WAR.
066: */
067: protected String jspRedirectorMapping;
068:
069: /**
070: * @see DeployableFile#getFile()
071: */
072: public final File getFile() {
073: return this .deployableFile;
074: }
075:
076: /**
077: * @param theDeployableFile the file to deploy
078: */
079: public final void setFile(File theDeployableFile) {
080: this .deployableFile = theDeployableFile;
081: }
082:
083: /**
084: * @see DeployableFile#getTestContext()
085: */
086: public final String getTestContext() {
087: return this .testContext;
088: }
089:
090: /**
091: * @see DeployableFile#setTestContext(String)
092: */
093: public final void setTestContext(String theTestContext) {
094: this .testContext = theTestContext;
095: }
096:
097: /**
098: * @see DeployableFile#getServletRedirectorMapping()
099: */
100: public final String getServletRedirectorMapping() {
101: return this .servletRedirectorMapping;
102: }
103:
104: /**
105: * @param theMapping the servlet redirector mapping
106: */
107: public final void setServletRedirectorMapping(String theMapping) {
108: this .servletRedirectorMapping = theMapping;
109: }
110:
111: /**
112: * @see DeployableFile#getFilterRedirectorMapping()
113: */
114: public final String getFilterRedirectorMapping() {
115: return this .filterRedirectorMapping;
116: }
117:
118: /**
119: * @param theMapping the filter redirector mapping
120: */
121: public final void setFilterRedirectorMapping(String theMapping) {
122: this .filterRedirectorMapping = theMapping;
123: }
124:
125: /**
126: * @see DeployableFile#getJspRedirectorMapping()
127: */
128: public final String getJspRedirectorMapping() {
129: return this .jspRedirectorMapping;
130: }
131:
132: /**
133: * @param theMapping the JSP redirector mapping
134: */
135: public final void setJspRedirectorMapping(String theMapping) {
136: this .jspRedirectorMapping = theMapping;
137: }
138:
139: /**
140: * @see DeployableFile#getWarArchive()
141: */
142: public final WarArchive getWarArchive() {
143: return this .warArchive;
144: }
145:
146: /**
147: * @see DeployableFile#clone()
148: */
149: public Object clone() throws CloneNotSupportedException {
150: AbstractDeployableFile file = (AbstractDeployableFile) super
151: .clone();
152: file.deployableFile = this .deployableFile;
153: file.warArchive = this .warArchive;
154: file.testContext = this .testContext;
155: file.servletRedirectorMapping = this .servletRedirectorMapping;
156: file.filterRedirectorMapping = this .filterRedirectorMapping;
157: file.jspRedirectorMapping = this .jspRedirectorMapping;
158: return file;
159: }
160:
161: /**
162: * @param theWarArchive the WAR archive object
163: */
164: public final void setWarArchive(WarArchive theWarArchive) {
165: this.warArchive = theWarArchive;
166: }
167:
168: }
|