KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cactus > integration > ant > container > resin > Resin3xContainer


1 /*
2  * ========================================================================
3  *
4  * Copyright 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.resin;
21
22 import java.io.File JavaDoc;
23 import java.io.IOException JavaDoc;
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,v 1.4 2004/05/31 20:05:22 vmassol Exp $
34  */

35 public class Resin3xContainer extends AbstractResinContainer
36 {
37     // AbstractContainer Implementation ----------------------------------------
38

39     /**
40      * @see org.apache.cactus.integration.ant.container.Container#getName
41      */

42     public final String JavaDoc getName()
43     {
44         return "Resin 3.x";
45     }
46     
47     // AbstractResinContainer Implementation -----------------------------------
48

49     /**
50      * @see AbstractResinContainer#getContainerDirName
51      */

52     protected final String JavaDoc getContainerDirName()
53     {
54         return "resin3x";
55     }
56
57     /**
58      * @see AbstractResinContainer#startUpAdditions(Java)
59      */

60     protected void startUpAdditions(Java theJavaContainer, Path theClasspath)
61     {
62         // It seems Resin 3.x requires the following property to be
63
// set in order to start...
64
theJavaContainer.addSysproperty(createSysProperty(
65             "java.util.logging.manager", "com.caucho.log.LogManagerImpl"));
66
67         // Add the resin_home/bin directory to the library path so that the
68
// resin dll/so can be loaded.
69
theJavaContainer.addSysproperty(createSysProperty(
70             "java.library.path", new File JavaDoc(getDir(), "bin")));
71
72         // Add the tools.jar to the classpath. This is not required for
73
// Resin 2.x but it is for Resin 3.x
74
addToolsJarToClasspath(theClasspath);
75     }
76
77     /**
78      * @see AbstractResinContainer#prepareAdditions(File, FilterChain)
79      */

80     protected void prepareAdditions(File JavaDoc theInstallDir,
81         FilterChain theFilterChain) throws IOException JavaDoc
82     {
83         ResourceUtils.copyResource(getProject(),
84             RESOURCE_PATH + getContainerDirName() + "/app-default.xml",
85             new File JavaDoc(theInstallDir, "app-default.xml"), theFilterChain);
86     }
87 }
88
Popular Tags