KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > rero > client > listeners > InternalEvents


1 package rero.client.listeners;
2
3 import rero.client.*;
4 import rero.bridges.event.*;
5
6 /** setup and register the internal client events... may as well keep it in one place. I want the frameworks to be
7 isolated from eachother as best as possible so that is why this stuff is in the client package. The client package is
8 more or less for tieing stuff together */

9
10 public class InternalEvents extends Feature
11 {
12     public void init()
13     {
14        EventBridge bridge = (EventBridge)getCapabilities().getDataStructure("eventBridge");
15
16        ScriptedEventListener connect = new _SocketStatusListener(getCapabilities().getSocketConnection(), true);
17        ScriptedEventListener disconnect = new _SocketStatusListener(getCapabilities().getSocketConnection(), false);
18        ScriptedEventListener raw = new _SocketDataListener(getCapabilities().getSocketConnection());
19        ScriptedEventListener ident = new _IdentListener();
20
21        bridge.registerEvent("connect", connect);
22        bridge.registerEvent("disconnect", disconnect);
23        bridge.registerEvent("raw", raw);
24        bridge.registerEvent("ident", ident);
25     }
26 }
27
Popular Tags