1 /* 2 * Copyright 1999-2001,2004 The Apache Software Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.apache.commons.workflow; 18 19 20 import java.util.EventListener; 21 22 23 /** 24 * A <strong>ContextListener</strong> registers its interest in receiving 25 * <code>ContextEvent</code> notifications when the occur on a particular 26 * <code>Context</code> of interest. 27 * 28 * @version $Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $ 29 * @author Craig R. McClanahan 30 */ 31 32 public interface ContextListener extends EventListener { 33 34 35 // --------------------------------------------------------- Public Methods 36 37 38 /** 39 * Invoked immediately after execution of the related Activity has 40 * been completed normally, been suspended, or been aborted by 41 * the throwing of a StepException. The Step included in this event 42 * will be the last one to be executed. 43 * 44 * @param event The <code>ContextEvent</code> that has occurred 45 */ 46 public void afterActivity(ContextEvent event); 47 48 49 50 /** 51 * Invoked immediately after the specified Step was executed. 52 * 53 * @param event The <code>ContextEvent</code> that has occurred 54 */ 55 public void afterStep(ContextEvent event); 56 57 58 /** 59 * Invoked immediately before execution of the related Activity has 60 * started. The Step included in this event will be the first one 61 * to be executed. 62 * 63 * @param event The <code>ContextEvent</code> that has occurred 64 */ 65 public void beforeActivity(ContextEvent event); 66 67 68 /** 69 * Invoked immediately before the specified Step is executed. 70 * 71 * @param event The <code>ContextEvent</code> that has occurred 72 */ 73 public void beforeStep(ContextEvent event); 74 75 76 }