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.EventObject; 021 022 023 /** 024 * A <strong>ScopeEvent</strong> provides notification to a 025 * <code>ScopeListener</code> that a specified event has occurred for 026 * the specified scope. 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 class ScopeEvent extends EventObject { 033 034 035 // ----------------------------------------------------------- Constructors 036 037 038 /** 039 * Construct a new immutable ScopeEvent. 040 * 041 * @param scope Scope in which this event occurred 042 * @param key Bean key on which this event occurred 043 * @param value Bean value on which this event occurred 044 */ 045 public ScopeEvent(Scope scope, String key, Object value) { 046 047 super(scope); 048 this.scope = scope; 049 this.key = key; 050 this.value = value; 051 052 } 053 054 055 // ------------------------------------------------------------- Properties 056 057 058 /** 059 * The bean key upon which this event occurred. 060 */ 061 protected String key = null; 062 063 public String getKey() { 064 065 return (this.key); 066 067 } 068 069 070 /** 071 * The <code>Scope</code> upon which this event occurred. 072 */ 073 protected Scope scope = null; 074 075 public Scope getScope() { 076 077 return (this.scope); 078 079 } 080 081 082 /** 083 * The bean value upon which this event occurred. For 084 * <code>beanReplaced</code> events, this will be the previous value. 085 */ 086 protected Object value = null; 087 088 public Object getValue() { 089 090 return (this.value); 091 092 } 093 094 095 }