KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > test > server > appserver > tomcat5x > Tomcat5xAppServerFactory


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.test.server.appserver.tomcat5x;
6
7 import com.tc.test.TestConfigObject;
8 import com.tc.test.server.appserver.AppServer;
9 import com.tc.test.server.appserver.AppServerInstallation;
10 import com.tc.test.server.appserver.AppServerParameters;
11 import com.tc.test.server.appserver.NewAppServerFactory;
12 import com.tc.test.server.appserver.war.DtdWar;
13 import com.tc.test.server.appserver.war.War;
14 import com.tc.test.server.tcconfig.StandardTerracottaAppServerConfig;
15
16 import java.io.File JavaDoc;
17 import java.net.URL JavaDoc;
18 import java.util.Properties JavaDoc;
19
20 /**
21  * This class creates specific implementations of return values for the given methods. To obtain an instance you must
22  * call {@link NewAppServerFactory.createFactoryFromProperties()}.
23  */

24 public final class Tomcat5xAppServerFactory extends NewAppServerFactory {
25
26   // This class may only be instantiated by its parent which contains the ProtectedKey
27
public Tomcat5xAppServerFactory(ProtectedKey protectedKey, TestConfigObject config) {
28     super(protectedKey, config);
29   }
30
31   public AppServerParameters createParameters(String JavaDoc instanceName, Properties JavaDoc props) {
32     return new Tomcat5xAppServerParameters(instanceName, props, config.sessionClasspath());
33   }
34
35   public AppServer createAppServer(AppServerInstallation installation) {
36     return new Tomcat5xAppServer((Tomcat5xAppServerInstallation) installation);
37   }
38
39   public AppServerInstallation createInstallation(URL JavaDoc host, File JavaDoc serverDir, File JavaDoc workingDir) throws Exception JavaDoc {
40     return new Tomcat5xAppServerInstallation(host, serverDir, workingDir, config.appserverMajorVersion(), config
41         .appserverMinorVersion());
42   }
43
44   public AppServerInstallation createInstallation(File JavaDoc home, File JavaDoc workingDir) throws Exception JavaDoc {
45     return new Tomcat5xAppServerInstallation(home, workingDir, config.appserverMajorVersion(), config
46         .appserverMinorVersion());
47   }
48
49   public War createWar(String JavaDoc appName) {
50     return new DtdWar(appName);
51   }
52
53   public StandardTerracottaAppServerConfig createTcConfig(File JavaDoc baseDir) {
54     return new Tomcat5xAppServerConfig(baseDir);
55   }
56 }
57
Popular Tags