01: /*
02: * ========================================================================
03: *
04: * Copyright 2004 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
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.resin;
21:
22: import java.io.File;
23: import java.io.IOException;
24:
25: import org.apache.cactus.integration.ant.util.ResourceUtils;
26: import org.apache.tools.ant.taskdefs.Java;
27: import org.apache.tools.ant.types.FilterChain;
28: import org.apache.tools.ant.types.Path;
29:
30: /**
31: * Special container support for the Caucho Resin 3.x servlet container.
32: *
33: * @version $Id: Resin3xContainer.java 239003 2004-05-31 20:05:27Z vmassol $
34: */
35: public class Resin3xContainer extends AbstractResinContainer {
36: // AbstractContainer Implementation ----------------------------------------
37:
38: /**
39: * @see org.apache.cactus.integration.ant.container.Container#getName
40: */
41: public final String getName() {
42: return "Resin 3.x";
43: }
44:
45: // AbstractResinContainer Implementation -----------------------------------
46:
47: /**
48: * @see AbstractResinContainer#getContainerDirName
49: */
50: protected final String getContainerDirName() {
51: return "resin3x";
52: }
53:
54: /**
55: * @see AbstractResinContainer#startUpAdditions(Java)
56: */
57: protected void startUpAdditions(Java theJavaContainer,
58: Path theClasspath) {
59: // It seems Resin 3.x requires the following property to be
60: // set in order to start...
61: theJavaContainer.addSysproperty(createSysProperty(
62: "java.util.logging.manager",
63: "com.caucho.log.LogManagerImpl"));
64:
65: // Add the resin_home/bin directory to the library path so that the
66: // resin dll/so can be loaded.
67: theJavaContainer.addSysproperty(createSysProperty(
68: "java.library.path", new File(getDir(), "bin")));
69:
70: // Add the tools.jar to the classpath. This is not required for
71: // Resin 2.x but it is for Resin 3.x
72: addToolsJarToClasspath(theClasspath);
73: }
74:
75: /**
76: * @see AbstractResinContainer#prepareAdditions(File, FilterChain)
77: */
78: protected void prepareAdditions(File theInstallDir,
79: FilterChain theFilterChain) throws IOException {
80: ResourceUtils.copyResource(getProject(), RESOURCE_PATH
81: + getContainerDirName() + "/app-default.xml", new File(
82: theInstallDir, "app-default.xml"), theFilterChain);
83: }
84: }
|