net.directj.csf
Class ServerEvent
java.lang.Object
|
+--java.util.EventObject
|
+--net.directj.csf.ServerEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class ServerEvent
- extends java.util.EventObject
A server event, fired by the server when it receive data from any client.
A server event can be fired in various siuation, like a new connection,
a end of a connection, a request from the client, ...
See the different implementation of server to know more about the differents event that can be fired.
This class also provide a mthod to obtain the client handler that fired the event, allow
the developper to do answer or get information obout the client.
- Version:
- 0.1.1
- Author:
- CARTAPANIS Alexandre <earendil@jprolog.net>
- See Also:
- Serialized Form
Field Summary |
private byte[] |
data
The event's data. |
Fields inherited from class java.util.EventObject |
source |
Method Summary |
byte[] |
getData()
Returns the data associated with this event. |
ClientHandler |
getHandler()
Returns the ClientHandler on which the event initially occurred.
|
Methods inherited from class java.util.EventObject |
getSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
data
private byte[] data
- The event's data.
ServerEvent
public ServerEvent(byte[] _data,
ClientHandler _handler)
- Creates a new ServerEvent.
- Parameters:
_data
- The data received by the server._handler
- The ClientHandler that fired this event.
getData
public byte[] getData()
- Returns the data associated with this event.
- Returns:
byte[]
- The data, as an array of bytes.
getHandler
public ClientHandler getHandler()
- Returns the ClientHandler on which the event initially occurred.
Equivalent to
(ClientHandler) getSource();
.
- Returns:
ClientHandler
- The client handler that fired this event.
Copyright © 2002 CARTAPANIS Alexandre
This page was last updated on May 10 2003