001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    //
021    // This source code implements specifications defined by the Java
022    // Community Process. In order to remain compliant with the specification
023    // DO NOT add / change / or delete method signatures!
024    //
025    
026    package javax.enterprise.deploy.spi.status;
027    
028    import javax.enterprise.deploy.spi.TargetModuleID;
029    import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException;
030    
031    /**
032     * The ProgressObject interface tracks and reports the progress of the
033     * deployment activities: distribute, start, stop, undeploy.
034     *
035     * This class has an <i>optional</i> cancel method.  The support of the cancel
036     * function can be tested by the isCancelSupported method.
037     *
038     * The ProgressObject structure allows the user the option of polling for
039     * status or to provide a callback.
040     *
041     * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25. Okt 2006) $
042     */
043    public interface ProgressObject {
044        /**
045         * Retrieve the status of this activity.
046         *
047         * @return An object containing the status information.
048         */
049        public DeploymentStatus getDeploymentStatus();
050    
051        /**
052         * Retrieve the list of TargetModuleIDs successfully processed or created
053         * by the associated DeploymentManager operation.
054         *
055         * @return a list of TargetModuleIDs.
056         */
057        public TargetModuleID[] getResultTargetModuleIDs();
058    
059        /**
060         * Return the ClientConfiguration object associated with the
061         * TargetModuleID.
062         *
063         * @return ClientConfiguration for a given TargetModuleID or <tt>null</tt>
064         *         if none exists.
065         */
066        public ClientConfiguration getClientConfiguration(TargetModuleID id);
067    
068        /**
069         * Tests whether the vendor supports a cancel operation for this
070         * deployment action.
071         *
072         * @return <tt>true</tt> if this platform allows this action to be
073         *         canceled.
074         */
075        public boolean isCancelSupported();
076    
077        /**
078         * (optional) A cancel request on an in-process operation stops all further
079         * processing of the operation and returns the environment to it original
080         * state before the operation was executed.  An operation that has run to
081         * completion cannot be cancelled.
082         *
083         * @throws OperationUnsupportedException occurs when this optional command
084         *         is not supported by this implementation.
085         */
086        public void cancel() throws OperationUnsupportedException;
087    
088        /**
089         * Tests whether the vendor supports a stop operation for the deployment
090         * action.
091         *
092         * @return <tt>true</tt> if this platform allows this action to be
093         *         stopped.
094         */
095        public boolean isStopSupported();
096    
097        /**
098         * (optional) A stop request on an in-process operation allows the
099         * operation on the current TargetModuleID to run to completion but does
100         * not process any of the remaining unprocessed TargetModuleID objects.
101         * The processed TargetModuleIDs must be returned by the method
102         * getResultTargetModuleIDs.
103         *
104         * @throws OperationUnsupportedException occurs when this optional command
105         *         is not supported by this implementation.
106         */
107        public void stop() throws OperationUnsupportedException;
108    
109        /**
110         * Add a listener to receive progress events on deployment actions.
111         *
112         * @param pol the listener to receive events
113         */
114        public void addProgressListener(ProgressListener pol);
115    
116        /**
117         * Remove a progress listener.
118         *
119         * @param pol the listener to remove
120         */
121        public void removeProgressListener(ProgressListener pol);
122    }