1 55 56 package org.apache.bsf.debug.meta; 57 58 import java.io.*; 59 import java.net.*; 60 import org.apache.bsf.debug.*; 61 import org.apache.bsf.debug.util.*; 62 63 public class DebugManagerDispatcher extends Dispatcher { 64 65 public DebugManagerDispatcher(SocketConnection con) { 66 super(con); 67 } 68 69 public void dispatch(ResultCell rcell) throws Exception { 70 71 String filename, lang; 72 int tid, uid; 73 boolean bool; 74 int bpid; 75 String docname; 76 int lineno; 77 BSFDebugManager self; 78 79 self = (BSFDebugManager) rcell.selfSkel; 80 switch (rcell.methodId) { 81 82 case DebugConstants.DM_QUIT_NOTIFY : 83 rcell.readInt(); 84 m_con.stopListening(); 85 rcell.voidResult(); 86 break; 87 88 case DebugConstants.DM_GET_LANG_FROM_FILENAME : 89 filename = (String ) rcell.readObject(); 90 lang = self.getLangFromFilename(filename); 91 rcell.objectResult(lang); 92 break; 93 94 case DebugConstants.DM_IS_LANGUAGE_REGISTERED : 95 lang = (String ) rcell.readObject(); 96 bool = self.isLanguageRegistered(lang); 97 rcell.booleanResult(bool); 98 break; 99 100 case DebugConstants.DM_SET_ENTRY_EXIT : 101 docname = (String ) rcell.readObject(); 102 bool = (rcell.readInt() == 0) ? false : true; 103 self.setEntryExit(docname, bool); 104 rcell.voidResult(); 105 break; 106 107 case DebugConstants.DM_PLACE_BREAKPOINT_AT_LINE : 108 109 bpid = rcell.readInt(); 110 docname = (String ) rcell.readObject(); 111 lineno = rcell.readInt(); 112 self.placeBreakpointAtLine(bpid, docname, lineno); 113 rcell.voidResult(); 114 break; 115 116 case DebugConstants.DM_REMOVE_BREAKPOINT : 117 118 docname = (String ) rcell.readObject(); 119 bpid = rcell.readInt(); 120 self.removeBreakpoint(docname, bpid); 121 122 rcell.voidResult(); 123 break; 124 125 case DebugConstants.DM_REGISTER_DEBUGGER_FOR_LANG : 126 BSFDebugger debugger; 127 128 lang = (String ) rcell.readObject(); 129 debugger = (BSFDebugger) rcell.readObject(); 130 131 self.registerDebugger(lang, debugger); 132 rcell.voidResult(); 133 break; 134 135 case DebugConstants.DM_UNREGISTER_DEBUGGER_FOR_LANG : 136 rcell.voidResult(); 137 break; 138 } 139 } 140 } 141 | Popular Tags |