KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xsocket > stream > io > spi > IIoHandlerContext


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

22 package org.xsocket.stream.io.spi;
23
24 import java.util.concurrent.Executor JavaDoc;
25
26
27
28 /**
29  * Provides the {@link IIoHandler}'s context parameters <br><br>
30  *
31  * <b>This class is experimental and is subject to change</b>
32  *
33  * @author grro@xsocket.org
34  */

35 public interface IIoHandlerContext {
36
37     /**
38      * the (shared) worker pool. In case of multithreaded {@link IIoHandlerContext#isMultithreaded()},
39      * this worker pool will also be used to perform the onXX callback Methods of the {@link IIoHandlerCallback} calls.
40      *
41      * @return the worker pool
42      */

43     public Executor JavaDoc getWorkerpool();
44     
45     
46     /**
47      * return if handling is multithreaded.
48      *
49      * @return true, if multithreaded
50      */

51     public boolean isMultithreaded();
52     
53     
54     
55     /**
56      * return if handler is thread save. If the appHandler is not thread-safe
57      * the IoHandler has to synchonize the callback methods
58      *
59      * @return true, if handler is threadsafe
60      */

61     public boolean isAppHandlerThreadSafe();
62     
63     
64     /**
65      * returns true, if the callback handler's onConnect method should be called
66      *
67      * @return true, if the callback handler's onConnect method should be called
68      */

69     public boolean isAppHandlerListenForConnectEvent();
70
71     
72     
73     /**
74      * returns true, if the callback handler's onData method should be called
75      *
76      * @return true, if the callback handler's onData method should be called
77      */

78     public boolean isAppHandlerListenForDataEvent();
79         
80     
81     /**
82      * returns true, if the callback handler's onDisconnect method should be called
83      *
84      * @return true, if the callback handler's onDisconnect method should be called
85      */

86     public boolean isAppHandlerListenforDisconnectEvent();
87         
88     
89     /**
90      * returns true, if the callback handler's onTimeout method should be called
91      *
92      * @return true, if the callback handler's onTimeout method should be called
93      */

94     public boolean isAppHandlerListenForTimeoutEvent();
95     
96 }
97
Popular Tags