1 18 package org.apache.activemq.state; 19 20 import org.apache.activemq.command.Response; 21 22 public class Tracked extends Response { 23 24 private Runnable runnable; 25 26 public Tracked(Runnable runnable) { 27 this.runnable = runnable; 28 } 29 30 public void onResponses() { 31 if( runnable != null ) { 32 runnable.run(); 33 runnable=null; 34 } 35 } 36 37 public boolean isWaitingForResponse() { 38 return runnable!=null; 39 } 40 41 } 42 | Popular Tags |