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