1 8 9 package rero.ircfw; 10 11 import java.util.WeakHashMap ; 12 import rero.ircfw.interfaces.ChatListener; 13 14 public class ChatFramework 15 { 16 protected ProtocolHandler protocol; 17 18 public ChatFramework() 19 { 20 protocol = new ProtocolHandler(); 21 } 22 23 public ProtocolHandler getProtocolHandler() 24 { 25 return protocol; 26 } 27 28 public ProtocolDispatcher getProtocolDispatcher() 29 { 30 return protocol.getProtocolDispatcher(); 31 } 32 33 35 public void storeDataStructures(WeakHashMap centralDataRepository) 36 { 37 centralDataRepository.put("clientInformation", protocol.getDataList()); 38 } 39 40 42 47 48 51 52 public void injectEvent(String data) 53 { 54 getProtocolHandler().handleProtocol(data); 55 } 56 57 58 60 public void addTemporaryListener(ChatListener l) 61 { 62 getProtocolHandler().getProtocolDispatcher().addTemporaryListener(l); 63 } 64 65 public void addChatListener(ChatListener l) 66 { 67 getProtocolHandler().getProtocolDispatcher().addChatListener(l); 68 } 69 } 70 | Popular Tags |