KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > enterprise > deploy > spi > status > ProgressObject


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.status;
25
26 import javax.enterprise.deploy.spi.TargetModuleID JavaDoc;
27 import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException JavaDoc;
28
29 /**
30  * The ProgressObject interface tracks and reports
31  * the progress of the deployment activities,
32  * distribute, start, stop, undeploy.
33  *
34  * <p>This class has an <code> optional</code> cancel
35  * method. The support of the cancel function can
36  * be tested by the isCancelSupported method.
37  * </p>
38  *
39  * <p>The ProgressObject structure allows the
40  * user the option of polling for status or to
41  * provide a callback.
42  * </p>
43  */

44 public interface ProgressObject
45 {
46
47    /**
48     * Retrieve the status of this activity.
49     *
50     * @return An object containing the status
51     * information.
52     */

53    public DeploymentStatus JavaDoc getDeploymentStatus();
54
55
56    /**
57     * Retrieve the list of TargetModuleIDs successfully
58     * processed or created by the associated DeploymentManager
59     * operation.
60     *
61     * @return a list of TargetModuleIDs.
62     */

63     public TargetModuleID JavaDoc [] getResultTargetModuleIDs();
64
65
66    /**
67     * Return the ClientConfiguration object associated with the
68     * TargetModuleID.
69     *
70     * @return ClientConfiguration for a given TargetModuleID or
71     * null if none exists.
72     */

73     public ClientConfiguration JavaDoc getClientConfiguration(TargetModuleID JavaDoc id);
74
75
76    /**
77     * Tests whether the vendor supports a cancel
78     * opertation for deployment activities.
79     *
80     * @return <code>true</code> if canceling an
81     * activity is supported by this platform.
82     */

83    public boolean isCancelSupported();
84
85    /**
86     * (optional)
87     * A cancel request on an in-process operation
88     * stops all further processing of the operation and returns
89     * the environment to it original state before the operation
90     * was executed. An operation that has run to completion
91     * cannot be cancelled.
92     *
93     * @throws OperationUnsupportedException this optional command
94     * is not supported by this implementation.
95     */

96    public void cancel() throws OperationUnsupportedException JavaDoc;
97
98    /**
99     * Tests whether the vendor supports a stop
100     * opertation for deployment activities.
101     *
102     * @return <code>true</code> if canceling an
103     * activity is supported by this platform.
104     */

105    public boolean isStopSupported();
106
107    /**
108     * (optional)
109     * A stop request on an in-process operation allows the
110     * operation on the current TargetModuleID to run to completion but
111     * does not process any of the remaining unprocessed TargetModuleID
112     * objects. The processed TargetModuleIDs must be returned by the
113     * method getResultTargetModuleIDs.
114     *
115     * @throws OperationUnsupportedException this optional command
116     * is not supported by this implementation.
117     */

118    public void stop() throws OperationUnsupportedException JavaDoc;
119
120    /**
121     * Add a listener to receive Progress events on deployment
122     * actions.
123     *
124     * @param pol the listener to receive events
125     * @see ProgressEvent
126     */

127    public void addProgressListener(ProgressListener JavaDoc pol);
128
129    /**
130     * Remove a ProgressObject listener.
131     *
132     * @param pol the listener being removed
133     * @see ProgressEvent
134     */

135    public void removeProgressListener(ProgressListener JavaDoc pol);
136 }
137
Popular Tags