KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > j2ee > 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  * OptionalFactory.java
21  *
22  * Created on January 12, 2004, 4:15 PM
23  */

24
25 package org.netbeans.modules.j2ee.sun.ide.j2ee;
26
27 import org.netbeans.modules.j2ee.deployment.plugins.api.AntDeploymentProvider;
28 import org.openide.WizardDescriptor;
29
30 import javax.enterprise.deploy.spi.DeploymentManager JavaDoc;
31 import org.netbeans.modules.j2ee.deployment.plugins.api.DatasourceManager;
32
33 import org.netbeans.modules.j2ee.deployment.plugins.api.OptionalDeploymentManagerFactory;
34 import org.netbeans.modules.j2ee.deployment.plugins.api.FindJSPServlet;
35 import org.netbeans.modules.j2ee.deployment.plugins.api.IncrementalDeployment;
36 import org.netbeans.modules.j2ee.deployment.plugins.api.StartServer;
37 import org.netbeans.modules.j2ee.deployment.plugins.api.TargetModuleIDResolver;
38 import org.netbeans.modules.j2ee.sun.ide.dm.SunDatasourceManager;
39 import org.netbeans.modules.j2ee.sun.ide.dm.SunDeploymentManager;
40 import org.netbeans.modules.j2ee.sun.ide.j2ee.jsps.FindJSPServletImpl;
41 import org.netbeans.modules.j2ee.sun.ide.j2ee.incrdeploy.DirectoryDeploymentFacade;
42 import org.netbeans.modules.j2ee.sun.ide.j2ee.ui.AddDomainWizardIterator;
43 //import org.netbeans.modules.j2ee.sun.ide.j2ee.ui.TargetServerData;
44
//import org.netbeans.modules.tomcat5.AntDeploymentProviderImpl;
45

46 /**
47  *
48  * @author ludo
49  */

50
51
52 public class OptionalFactory extends OptionalDeploymentManagerFactory {
53     
54     /** Creates a new instance of OptionalFactory */
55     public OptionalFactory () {
56     }
57     
58     public FindJSPServlet getFindJSPServlet (DeploymentManager JavaDoc dm) {
59         return new FindJSPServletImpl (dm);
60     }
61     
62     public IncrementalDeployment getIncrementalDeployment (DeploymentManager JavaDoc dm) {
63         return new DirectoryDeploymentFacade (dm);
64     }
65     
66     public StartServer getStartServer (DeploymentManager JavaDoc dm) {
67         return StartSunServer.get(dm);
68     }
69     
70     /** Create AutoUndeploySupport for the given DeploymentManager.
71      * The instance returned by this method will be cached by the j2eeserver.
72      */

73     public TargetModuleIDResolver getTargetModuleIDResolver(DeploymentManager JavaDoc dm) {
74         return null;
75     }
76     
77     public WizardDescriptor.InstantiatingIterator getAddInstanceIterator() {
78         WizardDescriptor.InstantiatingIterator retVal =
79                 new AddDomainWizardIterator();
80         return retVal;
81     }
82     
83     public AntDeploymentProvider getAntDeploymentProvider(DeploymentManager JavaDoc dm) {
84         return new AntDeploymentProviderImpl(dm);
85     }
86     
87     public DatasourceManager getDatasourceManager(DeploymentManager JavaDoc dm) {
88         if (!(dm instanceof SunDeploymentManager))
89             throw new IllegalArgumentException JavaDoc("");
90
91         SunDatasourceManager dsMgr = new SunDatasourceManager(dm);
92         return dsMgr;
93     }
94 }
95
Popular Tags