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.jsdi.*; 62 import org.apache.bsf.debug.util.*; 63 64 public class JsContextDispatcher extends Dispatcher { 65 66 public JsContextDispatcher(SocketConnection con) { 67 super(con); 68 } 69 70 public void dispatch(ResultCell rcell) throws Exception { 71 String name, lang; 72 int depth, lineno; 73 boolean bool; 74 JsContext cx; 75 Object obj; 76 JsContext self; 77 78 self = (JsContext) rcell.selfSkel; 79 80 switch (rcell.methodId) { 81 82 case DebugConstants.CX_BIND : 83 name = (String ) rcell.readObject(); 84 obj = self.bind(name); 85 rcell.objectResult(obj); 86 break; 87 88 case DebugConstants.CX_GET_SCOPE : 89 obj = self.getScope(); 90 rcell.objectResult(obj); 91 break; 92 93 case DebugConstants.CX_GET_SOURCE_NAME : 94 obj = self.getSourceName(); 95 rcell.objectResult(obj); 96 break; 97 98 case DebugConstants.CX_GET_CODE : 99 obj = self.getCode(); 100 rcell.objectResult(obj); 101 break; 102 103 case DebugConstants.CX_GET_THIS : 104 obj = self.getThis(); 105 rcell.objectResult(obj); 106 break; 107 108 case DebugConstants.CX_GET_DEPTH : 109 depth = self.getDepth(); 110 rcell.intResult(depth); 111 break; 112 case DebugConstants.CX_GET_ENGINE : 113 obj = self.getEngine(); 114 rcell.objectResult(obj); 115 break; 116 117 case DebugConstants.CX_GET_LINE_NUMBER : 118 lineno = self.getLineNumber(); 119 rcell.intResult(lineno); 120 break; 121 } 122 } 123 } 124 | Popular Tags |