001 /* 002 * Copyright 1999-2001,2004 The Apache Software Foundation. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.apache.commons.workflow; 018 019 020 import java.util.EventListener; 021 022 023 /** 024 * A <strong>ContextListener</strong> registers its interest in receiving 025 * <code>ContextEvent</code> notifications when the occur on a particular 026 * <code>Context</code> of interest. 027 * 028 * @version $Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $ 029 * @author Craig R. McClanahan 030 */ 031 032 public interface ContextListener extends EventListener { 033 034 035 // --------------------------------------------------------- Public Methods 036 037 038 /** 039 * Invoked immediately after execution of the related Activity has 040 * been completed normally, been suspended, or been aborted by 041 * the throwing of a StepException. The Step included in this event 042 * will be the last one to be executed. 043 * 044 * @param event The <code>ContextEvent</code> that has occurred 045 */ 046 public void afterActivity(ContextEvent event); 047 048 049 050 /** 051 * Invoked immediately after the specified Step was executed. 052 * 053 * @param event The <code>ContextEvent</code> that has occurred 054 */ 055 public void afterStep(ContextEvent event); 056 057 058 /** 059 * Invoked immediately before execution of the related Activity has 060 * started. The Step included in this event will be the first one 061 * to be executed. 062 * 063 * @param event The <code>ContextEvent</code> that has occurred 064 */ 065 public void beforeActivity(ContextEvent event); 066 067 068 /** 069 * Invoked immediately before the specified Step is executed. 070 * 071 * @param event The <code>ContextEvent</code> that has occurred 072 */ 073 public void beforeStep(ContextEvent event); 074 075 076 }