1 7 package org.jboss.test.remoting.transport.mock; 8 9 import java.io.Serializable ; 10 import java.util.List ; 11 import org.jboss.remoting.callback.Callback; 12 import org.jboss.remoting.callback.HandleCallbackException; 13 import org.jboss.remoting.callback.InvokerCallbackHandler; 14 15 18 public class MockInvokerCallbackHandler implements InvokerCallbackHandler, Serializable 19 { 20 private String callbackId; 21 private int callbacksRecieved = 0; 22 23 public MockInvokerCallbackHandler(String callbackId) 24 { 25 this.callbackId = callbackId; 26 } 27 28 36 public void handleCallback(Callback callback) 37 throws HandleCallbackException 38 { 39 System.err.println("We got callback on client. " + callback + " for " + this); 40 this.callbacksRecieved++; 41 } 42 43 public int isCallbackReceived() 44 { 45 System.err.println("returning " + callbacksRecieved + " for callback recieved for " + this); 46 return this.callbacksRecieved; 47 } 48 49 public String getId() 52 { 53 return callbackId; 54 } 55 56 61 public List getCallbacks() 64 { 65 return null; 66 } 67 68 73 public void destroy() 74 { 75 } 76 } 77 | Popular Tags |