1 /**
2 *
3 * Copyright 2003-2004 The Apache Software Foundation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
19
20
21
22
23
24 package javax.enterprise.deploy.spi.factories;
25
26 import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
27 import javax.enterprise.deploy.spi.DeploymentManager;
28
29 /**
30 * The DeploymentFactory interface is a deployment driver for a J2EE plaform
31 * product. It returns a DeploymentManager object which represents a
32 * connection to a specific J2EE platform product.
33 *
34 * Each application server vendor must provide an implementation of this class
35 * in order for the J2EE Deployment API to work with their product.
36 *
37 * The class implementing this interface should have a public no-argument
38 * constructor, and it should be stateless (two instances of the class should
39 * always behave the same). It is suggested but not required that the class
40 * have a static initializer that registers an instance of the class with the
41 * DeploymentFactoryManager class.
42 *
43 * A <tt>connected</tt> or <tt>disconnected</tt> DeploymentManager can be
44 * requested. A DeploymentManager that runs connected to the platform can
45 * provide access to J2EE resources. A DeploymentManager that runs
46 * disconnected only provides module deployment configuration support.
47 *
48 * @see javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
49 *
50 * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
51 */
52 public interface DeploymentFactory {
53 /**
54 * Tests whether this factory can create a DeploymentManager object based
55 * on the specified URI. This does not indicate whether such an attempt
56 * will be successful, only whether the factory can handle the uri.
57 *
58 * @param uri The uri to check
59 *
60 * @return <tt>true</tt> if the factory can handle the uri.
61 */
62 public boolean handlesURI(String uri);
63
64 /**
65 * Returns a <tt>connected</tt> DeploymentManager instance.
66 *
67 * @param uri The URI that specifies the connection parameters
68 * @param username An optional username (may be <tt>null</tt> if no
69 * authentication is required for this platform).
70 * @param password An optional password (may be <tt>null</tt> if no
71 * authentication is required for this platform).
72 *
73 * @return A ready DeploymentManager instance.
74 *
75 * @throws DeploymentManagerCreationException occurs when a
76 * DeploymentManager could not be returned (server down, unable
77 * to authenticate, etc).
78 */
79 public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException;
80
81 /**
82 * Returns a <tt>disconnected</tt> DeploymentManager instance.
83 *
84 * @param uri the uri of the DeploymentManager to return.
85 *
86 * @return A DeploymentManager <tt>disconnected</tt> instance.
87 *
88 * @throws DeploymentManagerCreationException occurs if the
89 * DeploymentManager could not be created.
90 */
91 public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException;
92
93 /**
94 * Provide a string with the name of this vendor's DeploymentManager.
95 *
96 * @return the name of the vendor's DeploymentManager.
97 */
98 public String getDisplayName();
99
100 /**
101 * Provides a string identifying the version of this vendor's
102 * DeploymentManager.
103 *
104 * @return the name of the vendor's DeploymentManager.
105 */
106 public String getProductVersion();
107 }