KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > phasing > DeploymentTargetFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * DeploymentTargetFactory.java
26  *
27  * Created on April 26, 2003, 3:51 PM
28  * @author sandhyae
29  * <BR> <I>$Source: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/deployment/phasing/DeploymentTargetFactory.java,v $
30  *
31  */

32
33 package com.sun.enterprise.deployment.phasing;
34
35 import com.sun.enterprise.admin.target.TargetType;
36 import com.sun.enterprise.config.ConfigContext;
37 import com.sun.enterprise.deployment.backend.IASDeploymentException;
38 import com.sun.enterprise.deployment.pluggable.DeploymentFactory;
39 import com.sun.enterprise.server.ApplicationServer;
40 import com.sun.enterprise.server.pluggable.PluggableFeatureFactory;
41
42 /**
43  * Interface that will be implemented by different targetfactories implemented
44  * for PE/EE
45  * @author Sandhya E
46  */

47 public abstract class DeploymentTargetFactory {
48
49     private static DeploymentTargetFactory targetFactory;
50
51     /**
52      * This is a singleton factory for the DeploymentService implementation. We should revisit
53      * this to make sure this will work in multi-threaded environment, i.e. concurrent deployment.
54      */

55     public static DeploymentTargetFactory getDeploymentTargetFactory() {
56
57         if (targetFactory != null) {
58             return targetFactory;
59         }
60
61         PluggableFeatureFactory featureFactory =
62             ApplicationServer.getServerContext().getPluggableFeatureFactory();
63         DeploymentFactory dFactory = featureFactory.getDeploymentFactory();
64         targetFactory = dFactory.createDeploymentTargetFactory();
65         return targetFactory;
66     }
67           
68     /**
69      * Returns the DeploymentTarget that represents a targetName
70      * @param configContext config context
71      * @param targetName name of the target
72      * @return DeploymentTarget
73      * @throws IASDeploymentException
74      */

75     public abstract DeploymentTarget getTarget(ConfigContext configContext ,
76             String JavaDoc domainName, String JavaDoc targetName) throws IASDeploymentException;
77     
78     /**
79      * Returns the default target
80      * @param configContext config context
81      * @return DeploymentTarget
82      * @throws IASDeploymentException
83      */

84     public abstract DeploymentTarget getTarget(ConfigContext configContext,
85             String JavaDoc domainName) throws IASDeploymentException;
86     
87     public abstract TargetType[] getValidDeploymentTargetTypes();
88 }
89
Popular Tags