View Javadoc

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  // This source code implements specifications defined by the Java
20  // Community Process. In order to remain compliant with the specification
21  // DO NOT add / change / or delete method signatures!
22  //
23  
24  package javax.enterprise.deploy.spi.status;
25  
26  import javax.enterprise.deploy.spi.TargetModuleID;
27  import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException;
28  
29  /**
30   * The ProgressObject interface tracks and reports the progress of the
31   * deployment activities: distribute, start, stop, undeploy.
32   *
33   * This class has an <i>optional</i> cancel method.  The support of the cancel
34   * function can be tested by the isCancelSupported method.
35   *
36   * The ProgressObject structure allows the user the option of polling for
37   * status or to provide a callback.
38   *
39   * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
40   */
41  public interface ProgressObject {
42      /**
43       * Retrieve the status of this activity.
44       *
45       * @return An object containing the status information.
46       */
47      public DeploymentStatus getDeploymentStatus();
48  
49      /**
50       * Retrieve the list of TargetModuleIDs successfully processed or created
51       * by the associated DeploymentManager operation.
52       *
53       * @return a list of TargetModuleIDs.
54       */
55      public TargetModuleID[] getResultTargetModuleIDs();
56  
57      /**
58       * Return the ClientConfiguration object associated with the
59       * TargetModuleID.
60       *
61       * @return ClientConfiguration for a given TargetModuleID or <tt>null</tt>
62       *         if none exists.
63       */
64      public ClientConfiguration getClientConfiguration(TargetModuleID id);
65  
66      /**
67       * Tests whether the vendor supports a cancel operation for this
68       * deployment action.
69       *
70       * @return <tt>true</tt> if this platform allows this action to be
71       *         canceled.
72       */
73      public boolean isCancelSupported();
74  
75      /**
76       * (optional) A cancel request on an in-process operation stops all further
77       * processing of the operation and returns the environment to it original
78       * state before the operation was executed.  An operation that has run to
79       * completion cannot be cancelled.
80       *
81       * @throws OperationUnsupportedException occurs when this optional command
82       *         is not supported by this implementation.
83       */
84      public void cancel() throws OperationUnsupportedException;
85  
86      /**
87       * Tests whether the vendor supports a stop operation for the deployment
88       * action.
89       *
90       * @return <tt>true</tt> if this platform allows this action to be
91       *         stopped.
92       */
93      public boolean isStopSupported();
94  
95      /**
96       * (optional) A stop request on an in-process operation allows the
97       * operation on the current TargetModuleID to run to completion but does
98       * not process any of the remaining unprocessed TargetModuleID objects.
99       * The processed TargetModuleIDs must be returned by the method
100      * getResultTargetModuleIDs.
101      *
102      * @throws OperationUnsupportedException occurs when this optional command
103      *         is not supported by this implementation.
104      */
105     public void stop() throws OperationUnsupportedException;
106 
107     /**
108      * Add a listener to receive progress events on deployment actions.
109      *
110      * @param pol the listener to receive events
111      */
112     public void addProgressListener(ProgressListener pol);
113 
114     /**
115      * Remove a progress listener.
116      *
117      * @param pol the listener to remove
118      */
119     public void removeProgressListener(ProgressListener pol);
120 }