Last change
on this file since 31592 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
|
Rev | Line | |
---|
[3661] | 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*/
|
---|
[5148] | 10 | private static final int EVENT_ID = RESERVED_ID_MAX+77;
|
---|
[3661] | 11 | /** The status associated with the event. */
|
---|
[31572] | 12 | private final int status;
|
---|
[3661] | 13 | /** Any message associated with this event. */
|
---|
[31572] | 14 | private final String message;
|
---|
[3661] | 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) {
|
---|
[5148] | 21 | super(source, EVENT_ID);
|
---|
| 22 | this.message = message;
|
---|
| 23 | this.status = status;
|
---|
[3661] | 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() {
|
---|
[5148] | 29 | return this.message;
|
---|
[3661] | 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() {
|
---|
[5148] | 35 | return this.status;
|
---|
[3661] | 36 | }
|
---|
| 37 | /** returns a String representation of the event */
|
---|
| 38 | public String toString() {
|
---|
[5148] | 39 | return "org.greenstone.gsdl3.build.ConstructionEvent[" + this.message
|
---|
| 40 | + "," + this.status + "]";
|
---|
[3661] | 41 | }
|
---|
| 42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.