KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > pept > transport > EventHandler


1 /*
2  * @(#)EventHandler.java 1.4 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.pept.transport;
9
10 import java.nio.channels.SelectableChannel JavaDoc;
11 import java.nio.channels.SelectionKey JavaDoc;
12
13 import com.sun.corba.se.spi.orbutil.threadpool.Work;
14
15 /**
16  * @author Harold Carr
17  *
18  * This should only be registered with ONE selector.
19  */

20 public interface EventHandler
21 {
22     public void setUseSelectThreadToWait(boolean x);
23     public boolean shouldUseSelectThreadToWait();
24
25     public SelectableChannel JavaDoc getChannel();
26
27     public int getInterestOps();
28
29     public void setSelectionKey(SelectionKey JavaDoc selectionKey);
30     public SelectionKey JavaDoc getSelectionKey();
31
32     public void handleEvent();
33
34     // NOTE: if there is more than one interest op this does not
35
// allow discrimination between different ops and how threading
36
// is handled.
37
public void setUseWorkerThreadForEvent(boolean x);
38     public boolean shouldUseWorkerThreadForEvent();
39
40     public void setWork(Work work);
41     public Work getWork();
42
43     // REVISIT: need base class with two derived.
44
public Acceptor getAcceptor();
45     public Connection getConnection();
46
47 }
48
49 // End of file.
50

51
52
53
54
55
56
57
58
Popular Tags