KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xsocket > IEventHandler


1 //$Id: IEventHandler.java 1049 2007-03-21 16:42:48Z grro $
2

3 /*
4  * Copyright (c) xsocket.org, 2006 - 2007. All rights reserved.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Please refer to the LGPL license at: http://www.gnu.org/copyleft/lesser.txt
21  * The latest copy of this software may be found on http://www.xsocket.org/
22  */

23 package org.xsocket;
24
25
26 import java.io.IOException JavaDoc;
27
28     
29
30 /**
31  * Handles readiness events managed by a {@link IDispatcher}
32  *
33  * @author grro@xsocket.org
34  */

35 public interface IEventHandler<T extends IHandle> {
36         
37     /**
38      * callback method for the <i>handle</i> registered event
39      *
40      * @param handle the assoiated handle
41      * @throws IOException If some I/O error occurs
42      */

43     public void onHandleRegisterEvent(T handle) throws IOException JavaDoc;
44
45
46     
47     /**
48      * callback method for a <i>handle</i> readable event
49      *
50      * @param handle the assoiated handle
51      * @throws IOException If some I/O error occurs
52      */

53     public void onHandleReadableEvent(T handle) throws IOException JavaDoc;
54
55     
56     /**
57      * callback nmethod for a <i>handle</i> writeable event
58      *
59      * @param handle the assoiated handle
60      * @throws IOException If some I/O error occurs
61      */

62     public void onHandleWriteableEvent(T handle) throws IOException JavaDoc;
63     
64     
65     
66     /**
67      * callback method for a <i>dispatcher</i> close event
68      *
69      * @param handle the assoiated handle
70      */

71     public void onDispatcherCloseEvent(T handle);
72
73 }
Popular Tags