KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > enterprise > deploy > spi > factories > DeploymentFactory


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 package javax.enterprise.deploy.spi.factories;
25
26 import javax.enterprise.deploy.spi.DeploymentManager JavaDoc;
27 import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException JavaDoc;
28
29 /**
30  * The DeploymentFactory interface is a deployment driver for a
31  * J2EE plaform product. It returns a DeploymentManager object
32  * which represents a connection to a specific J2EE platform
33  * product.
34  *
35  * <p> Each application server vendor must provide an implementation
36  * of this class in order for the J2EE Deployment API to work
37  * with their product.
38  *
39  * <p> The class implementing this interface should have a public
40  * no-argument constructor, and it should be stateless (two instances
41  * of the class should always behave the same). It is suggested but
42  * not required that the class have a static initializer that registers
43  * an instance of the class with the DeploymentFactoryManager class.
44  *
45  * <p> A <tt>connected</tt> or <tt>disconnected</tt> DeploymentManager
46  * can be requested. A DeploymentManager that runs connected to the
47  * platform can provide access to J2EE resources. A DeploymentManager
48  * that runs disconnected only provides module deployment configuration
49  * support.
50  *
51  * @see javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
52  */

53 public interface DeploymentFactory
54 {
55     /**
56      * Tests whether this factory can create a DeploymentManager
57      * object based on the specificed URI. This does not indicate
58      * whether such an attempt will be successful, only whether the
59      * factory can handle the uri.
60      * @param uri The uri to check
61      * @return <tt>true</tt> if the factory can handle the uri.
62      */

63     public boolean handlesURI(String JavaDoc uri);
64
65     /**
66      * Return a <tt>connected</tt> DeploymentManager instance.
67      *
68      * @param uri The URI that specifies the connection parameters
69      * @param username An optional username (may be <tt>null</tt> if
70      * no authentication is required for this platform).
71      * @param password An optional password (may be <tt>null</yy> if
72      * no authentication is required for this platform).
73      * @return A ready DeploymentManager instance.
74      * @throws DeploymentManagerCreationException occurs when a
75      * DeploymentManager could not be returned (server down,
76      * unable to authenticate, etc).
77      */

78     public DeploymentManager JavaDoc getDeploymentManager(String JavaDoc uri,
79             String JavaDoc username, String JavaDoc password)
80             throws DeploymentManagerCreationException JavaDoc;
81
82     /**
83      * Return a <tt>disconnected</tt> DeploymentManager instance.
84      *
85      * @param uri the uri of the DeploymentManager to return.
86      * @return A DeploymentManager <tt>disconnected</tt> instance.
87      * @throws DeploymentManagerCreationException occurs if the
88      * DeploymentManager could not be created.
89      */

90     public DeploymentManager JavaDoc getDisconnectedDeploymentManager(String JavaDoc uri)
91             throws DeploymentManagerCreationException JavaDoc;
92
93     /**
94      * Provide a string with the name of this vendor's DeploymentManager.
95      * @return the name of the vendor's DeploymentManager.
96      */

97     public String JavaDoc getDisplayName();
98
99     /**
100      * Provide a string identifying version of this vendor's
101      * DeploymentManager.
102      * @return the name of the vendor's DeploymentManager.
103      */

104     public String JavaDoc getProductVersion();
105 }
106
Popular Tags