1 55 56 package org.apache.bsf.debug.meta; 57 58 59 import java.rmi.RemoteException ; 60 import java.util.*; 61 import java.io.*; 62 import org.apache.bsf.debug.jsdi.*; 63 import org.apache.bsf.debug.util.*; 64 65 66 public class JsCallbacksStub extends Stub implements JsCallbacks { 67 68 public JsCallbacksStub(SocketConnection con, int tid, int uid) { 69 super(con,tid,uid); 70 } 71 72 75 public boolean poll() throws RemoteException { 76 77 ResultCell cell; 78 try { 79 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CALLBACKS_TID,DebugConstants.CB_POLL); 80 return cell.waitForBooleanValue(); 81 82 } catch (IOException ex) { 83 throw new RemoteException ("Marshalling error", ex); 84 } catch (Exception ex) { 85 throw new RemoteException ("Error at server", ex); 86 } 87 } 88 89 93 public void handleBreakpointHit(JsContext cx) 94 throws RemoteException { 95 96 ResultCell cell; 97 try { 98 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CALLBACKS_TID,DebugConstants.CB_HANDLE_BREAKPOINT_HIT); 99 cell.writeObject(cx); 100 101 cell.waitForCompletion(); 102 103 } catch (IOException ex) { 104 throw new RemoteException ("Marshalling error", ex); 105 } catch (Exception ex) { 106 throw new RemoteException ("Error at server", ex); 107 } 108 } 109 110 114 public void handleEngineStopped(JsContext cx) 115 throws RemoteException { 116 ResultCell cell; 117 try { 118 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CALLBACKS_TID,DebugConstants.CB_HANDLE_ENGINE_STOPPED); 119 cell.writeObject(cx); 120 121 cell.waitForCompletion(); 122 123 } catch (IOException ex) { 124 throw new RemoteException ("Marshalling error", ex); 125 } catch (Exception ex) { 126 throw new RemoteException ("Error at server", ex); 127 } 128 } 129 130 134 public void handleExceptionThrown(JsContext cx, Object exception) 135 throws RemoteException { 136 ResultCell cell; 137 try { 138 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CALLBACKS_TID,DebugConstants.CB_HANDLE_EXCEPTION_THROWN); 139 cell.writeObject(cx); 140 cell.writeObject(exception); 141 cell.waitForCompletion(); 142 143 } catch (IOException ex) { 144 throw new RemoteException ("Marshalling error", ex); 145 } catch (Exception ex) { 146 throw new RemoteException ("Error at server", ex); 147 } 148 } 149 150 151 155 public void handleSteppingDone(JsContext cx) 156 throws RemoteException { 157 ResultCell cell; 158 try { 159 cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_CALLBACKS_TID,DebugConstants.CB_HANDLE_STEPPING_DONE); 160 cell.writeObject(cx); 161 cell.waitForCompletion(); 162 163 } catch (IOException ex) { 164 throw new RemoteException ("Marshalling error", ex); 165 } catch (Exception ex) { 166 throw new RemoteException ("Error at server", ex); 167 } 168 } 169 170 171 } 172 173 | Popular Tags |