Richard S. Hall | 930fecc | 2005-08-16 18:33:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2005 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 | */ |
Richard S. Hall | 5a03159 | 2005-08-19 19:53:58 +0000 | [diff] [blame^] | 17 | package org.apache.felix.moduleloader; |
Richard S. Hall | 930fecc | 2005-08-16 18:33:34 +0000 | [diff] [blame] | 18 | |
| 19 | import java.util.EventObject; |
| 20 | |
| 21 | /** |
| 22 | * <p> |
| 23 | * This is an event class that is used by the <tt>ModuleManager</tt> to |
| 24 | * indicate when modules are added, removed, or reset. To receive these |
| 25 | * events, a <tt>ModuleListener</tt> must be added to the <tt>ModuleManager</tt> |
| 26 | * instance. |
| 27 | * </p> |
Richard S. Hall | 5a03159 | 2005-08-19 19:53:58 +0000 | [diff] [blame^] | 28 | * @see org.apache.felix.moduleloader.ModuleManager |
| 29 | * @see org.apache.felix.moduleloader.Module |
| 30 | * @see org.apache.felix.moduleloader.ModuleListener |
Richard S. Hall | 930fecc | 2005-08-16 18:33:34 +0000 | [diff] [blame] | 31 | **/ |
| 32 | public class ModuleEvent extends EventObject |
| 33 | { |
| 34 | private Module m_module = null; |
| 35 | |
| 36 | /** |
| 37 | * <p> |
| 38 | * Constructs a module event with the specified <tt>ModuleManager</tt> |
| 39 | * as the event source and the specified module as the subject of |
| 40 | * the event. |
| 41 | * </p> |
| 42 | * @param mgr the source of the event. |
| 43 | * @param module the subject of the event. |
| 44 | **/ |
| 45 | public ModuleEvent(ModuleManager mgr, Module module) |
| 46 | { |
| 47 | super(mgr); |
| 48 | m_module = module; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * <p> |
| 53 | * Returns the module that is the subject of the event. |
| 54 | * </p> |
| 55 | * @return the module that is the subject of the event. |
| 56 | **/ |
| 57 | public Module getModule() |
| 58 | { |
| 59 | return m_module; |
| 60 | } |
| 61 | } |