Last change
on this file since 31572 was 31572, checked in by ak19, 7 years ago |
Minor changes ahead of more major ones. Explicitly marking ConstructionEvent members immutable by declaring them final, to make them thread safe (to make them safe to share across multiple threads).
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.5 KB
|
Line | |
---|
1 | package org.greenstone.gsdl3.build;
|
---|
2 |
|
---|
3 | import java.awt.AWTEvent;
|
---|
4 |
|
---|
5 | public class ConstructionEvent
|
---|
6 | extends AWTEvent {
|
---|
7 |
|
---|
8 | /** the event id for these events - use a random number thats
|
---|
9 | not reserved*/
|
---|
10 | private static final int EVENT_ID = RESERVED_ID_MAX+77;
|
---|
11 | /** The status associated with the event. */
|
---|
12 | private final int status;
|
---|
13 | /** Any message associated with this event. */
|
---|
14 | private final String message;
|
---|
15 | /* Constructor.
|
---|
16 | * @param source The <strong>CollectionConstructor</strong> that fired this message.
|
---|
17 | * @param status The status code for this event
|
---|
18 | * @param message A <strong>String</strong> representing any message attatched with this event.
|
---|
19 | */
|
---|
20 | public ConstructionEvent(Object source, int status, String message) {
|
---|
21 | super(source, EVENT_ID);
|
---|
22 | this.message = message;
|
---|
23 | this.status = status;
|
---|
24 | }
|
---|
25 | /** Gets the message associated with this event.
|
---|
26 | * @return The message as a <strong>String</strong> or <i>null</i>.
|
---|
27 | */
|
---|
28 | public String getMessage() {
|
---|
29 | return this.message;
|
---|
30 | }
|
---|
31 | /** Gets the status associated with this event. This status can then be matched back to the constants in <strong>GShell</strong>.
|
---|
32 | * @return An <strong>int</strong> signifying the process status.
|
---|
33 | */
|
---|
34 | public int getStatus() {
|
---|
35 | return this.status;
|
---|
36 | }
|
---|
37 | /** returns a String representation of the event */
|
---|
38 | public String toString() {
|
---|
39 | return "org.greenstone.gsdl3.build.ConstructionEvent[" + this.message
|
---|
40 | + "," + this.status + "]";
|
---|
41 | }
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.