KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tomcat5 > ide > OptionalFactory


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.tomcat5.ide;
21
22 import javax.enterprise.deploy.spi.DeploymentManager JavaDoc;
23 import org.netbeans.modules.j2ee.deployment.plugins.api.AntDeploymentProvider;
24 import org.netbeans.modules.j2ee.deployment.plugins.api.DatasourceManager;
25 import org.netbeans.modules.j2ee.deployment.plugins.api.FindJSPServlet;
26 import org.netbeans.modules.j2ee.deployment.plugins.api.IncrementalDeployment;
27 import org.netbeans.modules.j2ee.deployment.plugins.api.OptionalDeploymentManagerFactory;
28 import org.netbeans.modules.j2ee.deployment.plugins.api.StartServer;
29 import org.netbeans.modules.j2ee.deployment.plugins.api.TargetModuleIDResolver;
30 import org.netbeans.modules.tomcat5.AntDeploymentProviderImpl;
31 import org.netbeans.modules.tomcat5.TomcatManager.TomcatVersion;
32 import org.netbeans.modules.tomcat5.config.TomcatDatasourceManager;
33 import org.netbeans.modules.tomcat5.jsps.FindJSPServletImpl;
34 import org.openide.WizardDescriptor;
35 import org.netbeans.modules.tomcat5.wizard.AddInstanceIterator;
36
37 /**
38  * OptionalFactory implementation
39  *
40  * @author Pavel Buzek
41  */

42 public class OptionalFactory extends OptionalDeploymentManagerFactory {
43     
44     private final TomcatVersion version;
45     
46     /** Creates a new instance of OptionalFactory */
47     private OptionalFactory(TomcatVersion version) {
48         this.version = version;
49     }
50     
51     public static OptionalFactory create50() {
52         return new OptionalFactory(TomcatVersion.TOMCAT_50);
53     }
54     
55     public static OptionalFactory create55() {
56         return new OptionalFactory(TomcatVersion.TOMCAT_55);
57     }
58     
59     public static OptionalFactory create60() {
60         return new OptionalFactory(TomcatVersion.TOMCAT_60);
61     }
62     
63     public FindJSPServlet getFindJSPServlet (javax.enterprise.deploy.spi.DeploymentManager JavaDoc dm) {
64         return new FindJSPServletImpl (dm);
65     }
66     
67     public IncrementalDeployment getIncrementalDeployment (javax.enterprise.deploy.spi.DeploymentManager JavaDoc dm) {
68         return new TomcatIncrementalDeployment (dm);
69     }
70     
71     public StartServer getStartServer (javax.enterprise.deploy.spi.DeploymentManager JavaDoc dm) {
72         return new StartTomcat (dm);
73     }
74     
75     public TargetModuleIDResolver getTargetModuleIDResolver(javax.enterprise.deploy.spi.DeploymentManager JavaDoc dm) {
76         return new TMIDResolver (dm);
77     }
78
79     public WizardDescriptor.InstantiatingIterator getAddInstanceIterator() {
80         return new AddInstanceIterator(version);
81     }
82     
83     public DatasourceManager getDatasourceManager(DeploymentManager JavaDoc dm) {
84         return new TomcatDatasourceManager(dm);
85     }
86     
87     public AntDeploymentProvider getAntDeploymentProvider(DeploymentManager JavaDoc dm) {
88         return new AntDeploymentProviderImpl(dm);
89     }
90 }
91
Popular Tags