PageRenderTime 13ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/core/src/com/bluemarsh/jswat/core/connect/ConnectionEvent.java

http://jswat.googlecode.com/
Java | 70 lines | 18 code | 6 blank | 46 comment | 0 complexity | a06c30743e3464d2689dcb415d5783a2 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception
 1/*
 2 * The contents of this file are subject to the terms of the Common Development
 3 * and Distribution License (the License). You may not use this file except in
 4 * compliance with the License.
 5 *
 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
 7 * or http://www.netbeans.org/cddl.txt.
 8 *
 9 * When distributing Covered Code, include this CDDL Header Notice in each file
10 * and include the License file at http://www.netbeans.org/cddl.txt.
11 * If applicable, add the following below the CDDL Header, with the fields
12 * enclosed by brackets [] replaced by your own identifying information:
13 * "Portions Copyrighted [year] [name of copyright owner]"
14 *
15 * The Original Software is JSwat. The Initial Developer of the Original
16 * Software is Nathan L. Fiedler. Portions created by Nathan L. Fiedler
17 * are Copyright (C) 2006-2010. All Rights Reserved.
18 *
19 * Contributor(s): Nathan L. Fiedler.
20 *
21 * $Id: ConnectionEvent.java 282 2010-11-19 15:28:17Z nathanfiedler $
22 */
23package com.bluemarsh.jswat.core.connect;
24
25import java.util.EventObject;
26
27/**
28 * Represents a change in a JvmConnection.
29 *
30 * @author Nathan Fiedler
31 */
32public class ConnectionEvent extends EventObject {
33
34    /** silence the compiler warnings */
35    private static final long serialVersionUID = 1L;
36    /** The source of this event. */
37    private final JvmConnection connection;
38    /** The type of connection change. */
39    private final ConnectionEventType type;
40
41    /**
42     * Creates a new instance of ConnectionEvent.
43     *
44     * @param  connection  the JVM connection.
45     * @param  type        type type of the event.
46     */
47    public ConnectionEvent(JvmConnection connection, ConnectionEventType type) {
48        super(connection);
49        this.connection = connection;
50        this.type = type;
51    }
52
53    /**
54     * Returns the JvmConnection relating to this event.
55     *
56     * @return  JvmConnection for this event.
57     */
58    public JvmConnection getConnection() {
59        return connection;
60    }
61
62    /**
63     * Get the connection event type.
64     *
65     * @return  connection event type.
66     */
67    public ConnectionEventType getType() {
68        return type;
69    }
70}