View Javadoc

1   package fr.ove.clientserver.events;
2   
3   import java.util.EventObject;
4   import java.net.Socket;
5   
6   /***
7   * The event sent by a socket server.
8   */
9   public class SocketServerEvent extends EventObject {
10      /***
11      * The socket the instance encapsulates.
12      */
13      private Socket socket;
14      
15      /***
16      * The constructor.
17      * @param src the source of the event.
18      */
19      public SocketServerEvent(Object src) {
20          super(src);
21      }
22      
23      /***
24      * Sets the socket to the instance.
25      * @param socket the socket to encapsulate.
26      */
27      public void setSocket(Socket socket) {
28          this.socket = socket;
29      }
30      
31      /***
32      * Returns the socket encapsulated in the instance.
33      */
34      public Socket getSocket() {
35          return socket;
36      }
37  }
38      
39