KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > test > server > appserver > wasce1x > Wasce1xAppServerFactory


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

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

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