Allow the connector to override if async dispatch is allowed.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@418162 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-06-30 01:43:12 +00:00
parent 9c135637f9
commit 24d8986cee
1 changed files with 11 additions and 1 deletions

View File

@ -64,6 +64,7 @@ public class TransportConnector implements Connector {
private URI discoveryUri;
private URI connectUri;
private String name;
private boolean disableAsyncDispatch=false;
/**
@ -94,6 +95,7 @@ public class TransportConnector implements Connector {
rc.setDiscoveryAgent(discoveryAgent);
rc.setDiscoveryUri(discoveryUri);
rc.setName(name);
rc.setDisableAsyncDispatch(disableAsyncDispatch);
return rc;
}
@ -228,7 +230,7 @@ public class TransportConnector implements Connector {
// Implementation methods
// -------------------------------------------------------------------------
protected Connection createConnection(Transport transport) throws IOException {
TransportConnection answer = new TransportConnection(this, transport, broker, taskRunnerFactory);
TransportConnection answer = new TransportConnection(this, transport, broker, disableAsyncDispatch ? null : taskRunnerFactory);
answer.setMessageAuthorizationPolicy(messageAuthorizationPolicy);
return answer;
}
@ -303,4 +305,12 @@ public class TransportConnector implements Connector {
public String toString() {
return getName();
}
public boolean isDisableAsyncDispatch() {
return disableAsyncDispatch;
}
public void setDisableAsyncDispatch(boolean disableAsyncDispatch) {
this.disableAsyncDispatch = disableAsyncDispatch;
}
}