1 55 56 package org.apache.bsf.debug.meta; 57 58 import java.rmi.RemoteException ; 59 import java.util.*; 60 import java.io.*; 61 import org.apache.bsf.debug.jsdi.*; 62 import org.apache.bsf.debug.util.*; 63 64 public class JsContextStub extends Stub implements JsContext { 65 public JsContextStub(SocketConnection m_con, int tid, int uid) { 66 super(m_con,tid,uid); 67 } 68 69 95 96 public JsObject bind(String id) throws RemoteException { 97 98 ResultCell cell; 99 100 try { 101 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_BIND); 102 cell.writeObject(id); 103 return (JsObject)cell.waitForObject(); 104 105 } catch (IOException ex) { 106 throw new RemoteException ("Marshalling error", ex); 107 } catch (Exception ex) { 108 throw new RemoteException ("Error at server", ex); 109 } 110 } 111 112 public JsCode getCode() throws RemoteException { 113 114 ResultCell cell; 115 try { 116 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_GET_CODE); 117 return (JsCode)cell.waitForObject(); 118 119 } catch (IOException ex) { 120 throw new RemoteException ("Marshalling error", ex); 121 } catch (Exception ex) { 122 throw new RemoteException ("Error at server", ex); 123 } 124 } 125 126 public int getDepth() throws RemoteException { 127 128 ResultCell cell; 129 try { 130 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_GET_DEPTH); 131 return cell.waitForIntValue(); 132 133 } catch (IOException ex) { 134 throw new RemoteException ("Marshalling error", ex); 135 } catch (Exception ex) { 136 throw new RemoteException ("Error at server", ex); 137 } 138 } 139 140 public JsEngine getEngine() throws RemoteException { 141 ResultCell cell; 142 try { 143 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_GET_ENGINE); 144 return (JsEngine)cell.waitForObject(); 145 146 } catch (IOException ex) { 147 throw new RemoteException ("Marshalling error", ex); 148 } catch (Exception ex) { 149 throw new RemoteException ("Error at server", ex); 150 } 151 } 152 153 public int getLineNumber() throws RemoteException { 154 155 ResultCell cell; 156 try { 157 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_GET_LINE_NUMBER); 158 return cell.waitForIntValue(); 159 160 } catch (IOException ex) { 161 throw new RemoteException ("Marshalling error", ex); 162 } catch (Exception ex) { 163 throw new RemoteException ("Error at server", ex); 164 } 165 } 166 public JsObject getScope() throws RemoteException { 167 168 ResultCell cell; 169 try { 170 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_GET_SCOPE); 171 return (JsObject)cell.waitForObject(); 172 173 } catch (IOException ex) { 174 throw new RemoteException ("Marshalling error", ex); 175 } catch (Exception ex) { 176 throw new RemoteException ("Error at server", ex); 177 } 178 } 179 public String getSourceName() throws RemoteException { 180 181 ResultCell cell; 182 try { 183 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_GET_SOURCE_NAME); 184 return (String )cell.waitForValueObject(); 185 186 } catch (IOException ex) { 187 throw new RemoteException ("Marshalling error", ex); 188 } catch (Exception ex) { 189 throw new RemoteException ("Error at server", ex); 190 } 191 } 192 public JsObject getThis() throws RemoteException { 193 194 ResultCell cell; 195 try { 196 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CONTEXT_TID,DebugConstants.CX_GET_THIS); 197 return (JsObject)cell.waitForObject(); 198 199 } catch (IOException ex) { 200 throw new RemoteException ("Marshalling error", ex); 201 } catch (Exception ex) { 202 throw new RemoteException ("Error at server", ex); 203 } 204 } 205 } 206 207 | Popular Tags |