KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > kernel > IConnectionInfo


1 package com.ubermq.kernel;
2
3 import com.ubermq.kernel.DatagramSink;
4 import com.ubermq.kernel.event.ConnectionEventListener;
5
6 /**
7  * Represents a connection that can send and receive datagrams
8  * and has a state.
9  */

10 public interface IConnectionInfo
11     extends DatagramSink
12 {
13     /**
14      * Close the connection. The connection's resources will be cleaned up
15      * and processing related to the connection will cease. Output requests
16      * will no longer be honored.
17      */

18     public void close();
19
20     /**
21      * The identifier for the connection.
22      * @return a String identifying the connection.
23      */

24     public String JavaDoc getId();
25
26     /**
27      * Start processing of datagrams on behalf of this connection.
28      */

29     public void start();
30
31     /**
32      * Stop, or pause, processing of datagrams. Processing may be resumed
33      * by calling <code>start</code> again.
34      */

35     public void stop();
36
37     /**
38      * Adds an event listener object that is called when events
39      * occur on the connection.
40      * @param l an event listener implementation
41      */

42     public void addEventListener(ConnectionEventListener l);
43
44     /**
45      * Removes an event listener object that was previously registered.
46      * @param l an event listener, previously registered with addEventListener
47      */

48     public void removeEventListener(ConnectionEventListener l);
49
50     /**
51      * Accepts incoming conenctions
52      */

53     public interface ConnectionAcceptor
54     {
55         /**
56          * Accepts an incoming conenction.
57          */

58         public void acceptIncomingConnection(IConnectionInfo incoming);
59     }
60 }
61
Popular Tags