KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > test > server > appserver > jboss4x > JBoss4xAppServerFactory


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