4320 |
29 May 08 |
nicklas |
1 |
/** |
4320 |
29 May 08 |
nicklas |
$Id$ |
4320 |
29 May 08 |
nicklas |
3 |
|
4320 |
29 May 08 |
nicklas |
Copyright (C) 2008 Nicklas Nordborg |
4320 |
29 May 08 |
nicklas |
5 |
|
4320 |
29 May 08 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
4320 |
29 May 08 |
nicklas |
Available at http://base.thep.lu.se/ |
4320 |
29 May 08 |
nicklas |
8 |
|
4320 |
29 May 08 |
nicklas |
BASE is free software; you can redistribute it and/or |
4320 |
29 May 08 |
nicklas |
modify it under the terms of the GNU General Public License |
4479 |
05 Sep 08 |
jari |
as published by the Free Software Foundation; either version 3 |
4320 |
29 May 08 |
nicklas |
of the License, or (at your option) any later version. |
4320 |
29 May 08 |
nicklas |
13 |
|
4320 |
29 May 08 |
nicklas |
BASE is distributed in the hope that it will be useful, |
4320 |
29 May 08 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4320 |
29 May 08 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4320 |
29 May 08 |
nicklas |
GNU General Public License for more details. |
4320 |
29 May 08 |
nicklas |
18 |
|
4320 |
29 May 08 |
nicklas |
You should have received a copy of the GNU General Public License |
4515 |
11 Sep 08 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4320 |
29 May 08 |
nicklas |
21 |
*/ |
4320 |
29 May 08 |
nicklas |
22 |
package net.sf.basedb.util.extensions.events; |
4320 |
29 May 08 |
nicklas |
23 |
|
4320 |
29 May 08 |
nicklas |
24 |
import net.sf.basedb.util.extensions.Extension; |
4320 |
29 May 08 |
nicklas |
25 |
import net.sf.basedb.util.extensions.ExtensionPoint; |
4320 |
29 May 08 |
nicklas |
26 |
import net.sf.basedb.util.extensions.Registry; |
4320 |
29 May 08 |
nicklas |
27 |
|
4320 |
29 May 08 |
nicklas |
28 |
/** |
4320 |
29 May 08 |
nicklas |
Represents different types of event. Some event types has been defined |
4320 |
29 May 08 |
nicklas |
as static members of this class. External applications can create |
4320 |
29 May 08 |
nicklas |
their own event types and send to registered extensions by |
4320 |
29 May 08 |
nicklas |
calling {@link Registry#handleEvent(EventType, ExtensionPoint, Extension)}. |
4320 |
29 May 08 |
nicklas |
33 |
|
4320 |
29 May 08 |
nicklas |
@author nicklas |
4320 |
29 May 08 |
nicklas |
@version 2.8 |
4320 |
29 May 08 |
nicklas |
@base.modified $Date$ |
4320 |
29 May 08 |
nicklas |
37 |
*/ |
4320 |
29 May 08 |
nicklas |
38 |
public class EventType |
4320 |
29 May 08 |
nicklas |
39 |
{ |
4320 |
29 May 08 |
nicklas |
40 |
|
4320 |
29 May 08 |
nicklas |
41 |
/** |
4320 |
29 May 08 |
nicklas |
This event is sent after an extension or extension point has been |
4320 |
29 May 08 |
nicklas |
registered with a registry. |
4320 |
29 May 08 |
nicklas |
44 |
*/ |
4320 |
29 May 08 |
nicklas |
45 |
public static final EventType AFTER_REGISTRATION = new EventType("After registration"); |
4320 |
29 May 08 |
nicklas |
46 |
|
4320 |
29 May 08 |
nicklas |
47 |
/** |
4320 |
29 May 08 |
nicklas |
This event is sent during an update of an existing extension point or |
4320 |
29 May 08 |
nicklas |
extension. The arguments to the {@link EventHandler#handleEvent(EventType, ExtensionPoint, Extension)} |
4320 |
29 May 08 |
nicklas |
method is the currently registered extension point and extension. This |
4320 |
29 May 08 |
nicklas |
event will be followed by {@link #AFTER_UPDATE}. |
4320 |
29 May 08 |
nicklas |
52 |
*/ |
4320 |
29 May 08 |
nicklas |
53 |
public static final EventType BEFORE_UPDATE = new EventType("Before update"); |
4320 |
29 May 08 |
nicklas |
54 |
|
4320 |
29 May 08 |
nicklas |
55 |
/** |
4320 |
29 May 08 |
nicklas |
This event is sent during an update of an existing extension point or |
4320 |
29 May 08 |
nicklas |
extension. The arguments to the {@link EventHandler#handleEvent(EventType, ExtensionPoint, Extension)} |
4320 |
29 May 08 |
nicklas |
method is the new extension point and extension. This event is preceeded by |
4320 |
29 May 08 |
nicklas |
{@link #BEFORE_UPDATE}. |
4320 |
29 May 08 |
nicklas |
60 |
*/ |
4320 |
29 May 08 |
nicklas |
61 |
public static final EventType AFTER_UPDATE = new EventType("After update"); |
4320 |
29 May 08 |
nicklas |
62 |
|
4320 |
29 May 08 |
nicklas |
63 |
/** |
4320 |
29 May 08 |
nicklas |
This event is sent before an extension point or extension is |
4320 |
29 May 08 |
nicklas |
unregistered. |
4320 |
29 May 08 |
nicklas |
66 |
*/ |
4320 |
29 May 08 |
nicklas |
67 |
public static final EventType BEFORE_UNREGISTRATION = new EventType("Before unregistration"); |
4320 |
29 May 08 |
nicklas |
68 |
|
4320 |
29 May 08 |
nicklas |
69 |
private final String name; |
4320 |
29 May 08 |
nicklas |
70 |
|
4320 |
29 May 08 |
nicklas |
71 |
/** |
4320 |
29 May 08 |
nicklas |
Create a new event type. |
4320 |
29 May 08 |
nicklas |
@param name A display name to use in the {@link #toString()} method |
4320 |
29 May 08 |
nicklas |
74 |
*/ |
4320 |
29 May 08 |
nicklas |
75 |
public EventType(String name) |
4320 |
29 May 08 |
nicklas |
76 |
{ |
4320 |
29 May 08 |
nicklas |
77 |
this.name = name; |
4320 |
29 May 08 |
nicklas |
78 |
} |
4320 |
29 May 08 |
nicklas |
79 |
|
4320 |
29 May 08 |
nicklas |
80 |
@Override |
4320 |
29 May 08 |
nicklas |
81 |
public String toString() |
4320 |
29 May 08 |
nicklas |
82 |
{ |
4320 |
29 May 08 |
nicklas |
83 |
return name; |
4320 |
29 May 08 |
nicklas |
84 |
} |
4320 |
29 May 08 |
nicklas |
85 |
|
4320 |
29 May 08 |
nicklas |
86 |
} |