public void stop() throws Exception {
this.subscriptionRecoveryPolicy.stop();
}
public Message[] browse(){
final Set result=new CopyOnWriteArraySet();
try{
if(store!=null){
store.recover(new MessageRecoveryListener(){
public void recoverMessage(Message message) throws Exception{
result.add(message);
}
public void recoverMessageReference(String messageReference) throws Exception{}
public void finished(){}
});
Message[] msgs=subscriptionRecoveryPolicy.browse(getActiveMQDestination());
if(msgs!=null){
for(int i=0;i<msgs.length;i++){
result.add(msgs[i]);
}
}
}
}catch(Throwable e){
log.warn("Failed to browse Topic: "+getActiveMQDestination().getPhysicalName(),e);
}
return (Message[]) result.toArray(new Message[result.size()]);
}