KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > test > server > appserver > weblogic8x > Weblogic8xAppServerFactory


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.weblogic8x;
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.DescriptorXml;
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 Weblogic8xAppServerFactory extends NewAppServerFactory {
25
26   // This class may only be instantiated by it's parent which contains the ProtectedKey
27
public Weblogic8xAppServerFactory(ProtectedKey protectedKey, TestConfigObject config) {
28     super(protectedKey, config);
29   }
30
31   public AppServerParameters createParameters(String JavaDoc instanceName, Properties JavaDoc props) {
32     return new Weblogic8xAppServerParameters(instanceName, props, config.sessionClasspath());
33   }
34
35   public AppServer createAppServer(AppServerInstallation installation) {
36     return new Weblogic8xAppServer((Weblogic8xAppServerInstallation) installation);
37   }
38
39   public AppServerInstallation createInstallation(URL JavaDoc host, File JavaDoc serverDir, File JavaDoc workingDir) throws Exception JavaDoc {
40     return new Weblogic8xAppServerInstallation(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 Weblogic8xAppServerInstallation(home, workingDir, config.appserverMajorVersion(), config
46         .appserverMinorVersion());
47   }
48
49   public War createWar(String JavaDoc appName) {
50     War war = new DtdWar(appName);
51     DescriptorXml weblogicWar = new Weblogic8xDescriptorXml();
52     war.addContainerSpecificXml(weblogicWar.getFileName(), weblogicWar.getBytes());
53     return war;
54   }
55
56   public StandardTerracottaAppServerConfig createTcConfig(File JavaDoc baseDir) {
57     return new Weblogic8xAppServerConfig(baseDir);
58   }
59 }
60
Popular Tags