Eliminated an unneed Thread.currentThread().interrupt();

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@418156 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-06-30 00:13:25 +00:00
parent f5ffb39243
commit 9c135637f9
2 changed files with 9 additions and 19 deletions

View File

@ -57,7 +57,7 @@ public class FutureResponse {
} }
} }
public void set(Response result) throws InterruptedIOException { public void set(Response result) {
if( responseSlot.offer(result) ) { if( responseSlot.offer(result) ) {
if( responseCallback !=null ) { if( responseCallback !=null ) {
responseCallback.onCompletion(this); responseCallback.onCompletion(this);

View File

@ -17,9 +17,7 @@
package org.apache.activemq.transport; package org.apache.activemq.transport;
import java.io.IOException; import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import org.apache.activemq.command.Command; import org.apache.activemq.command.Command;
@ -82,16 +80,12 @@ public class ResponseCorrelator extends TransportFilter {
public void onCommand(Command command) { public void onCommand(Command command) {
boolean debug = log.isDebugEnabled(); boolean debug = log.isDebugEnabled();
if( command.isResponse() ) { if( command.isResponse() ) {
try { Response response = (Response) command;
Response response = (Response) command; FutureResponse future = (FutureResponse) requestMap.remove(new Integer(response.getCorrelationId()));
FutureResponse future = (FutureResponse) requestMap.remove(new Integer(response.getCorrelationId())); if( future!=null ) {
if( future!=null ) { future.set(response);
future.set(response); } else {
} else { if( debug ) log.debug("Received unexpected response for command id: "+response.getCorrelationId());
if( debug ) log.debug("Received unexpected response for command id: "+response.getCorrelationId());
}
} catch (InterruptedIOException e) {
onException(e);
} }
} else { } else {
getTransportListener().onCommand(command); getTransportListener().onCommand(command);
@ -109,12 +103,8 @@ public class ResponseCorrelator extends TransportFilter {
requestMap.clear(); requestMap.clear();
for (Iterator iter = requests.iterator(); iter.hasNext();) { for (Iterator iter = requests.iterator(); iter.hasNext();) {
try { FutureResponse fr = (FutureResponse) iter.next();
FutureResponse fr = (FutureResponse) iter.next(); fr.set(new ExceptionResponse(error));
fr.set(new ExceptionResponse(error));
} catch (InterruptedIOException e) {
Thread.currentThread().interrupt();
}
} }
super.onException(error); super.onException(error);