mirror of https://github.com/apache/activemq.git
This commit is contained in:
parent
3adffc18e1
commit
307005ab4f
|
@ -75,6 +75,7 @@ public class VMTransport implements Transport, Task {
|
||||||
this.peer = peer;
|
this.peer = peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void oneway(Object command) throws IOException {
|
public void oneway(Object command) throws IOException {
|
||||||
|
|
||||||
if (disposed.get()) {
|
if (disposed.get()) {
|
||||||
|
@ -137,6 +138,7 @@ public class VMTransport implements Transport, Task {
|
||||||
transportListener.onCommand(command);
|
transportListener.onCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void start() throws Exception {
|
public void start() throws Exception {
|
||||||
|
|
||||||
if (transportListener == null) {
|
if (transportListener == null) {
|
||||||
|
@ -165,6 +167,7 @@ public class VMTransport implements Transport, Task {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void stop() throws Exception {
|
public void stop() throws Exception {
|
||||||
// Only need to do this once, all future oneway calls will now
|
// Only need to do this once, all future oneway calls will now
|
||||||
// fail as will any asnyc jobs in the task runner.
|
// fail as will any asnyc jobs in the task runner.
|
||||||
|
@ -187,7 +190,7 @@ public class VMTransport implements Transport, Task {
|
||||||
tr.shutdown(TimeUnit.SECONDS.toMillis(1));
|
tr.shutdown(TimeUnit.SECONDS.toMillis(1));
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
}
|
}
|
||||||
taskRunner = null;
|
tr = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// let the peer know that we are disconnecting after attempting
|
// let the peer know that we are disconnecting after attempting
|
||||||
|
@ -226,6 +229,7 @@ public class VMTransport implements Transport, Task {
|
||||||
/**
|
/**
|
||||||
* @see org.apache.activemq.thread.Task#iterate()
|
* @see org.apache.activemq.thread.Task#iterate()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean iterate() {
|
public boolean iterate() {
|
||||||
|
|
||||||
final TransportListener tl = transportListener;
|
final TransportListener tl = transportListener;
|
||||||
|
@ -249,6 +253,7 @@ public class VMTransport implements Transport, Task {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setTransportListener(TransportListener commandListener) {
|
public void setTransportListener(TransportListener commandListener) {
|
||||||
this.transportListener = commandListener;
|
this.transportListener = commandListener;
|
||||||
}
|
}
|
||||||
|
@ -300,22 +305,27 @@ public class VMTransport implements Transport, Task {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException {
|
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException {
|
||||||
throw new AssertionError("Unsupported Method");
|
throw new AssertionError("Unsupported Method");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object request(Object command) throws IOException {
|
public Object request(Object command) throws IOException {
|
||||||
throw new AssertionError("Unsupported Method");
|
throw new AssertionError("Unsupported Method");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object request(Object command, int timeout) throws IOException {
|
public Object request(Object command, int timeout) throws IOException {
|
||||||
throw new AssertionError("Unsupported Method");
|
throw new AssertionError("Unsupported Method");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransportListener getTransportListener() {
|
public TransportListener getTransportListener() {
|
||||||
return transportListener;
|
return transportListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> T narrow(Class<T> target) {
|
public <T> T narrow(Class<T> target) {
|
||||||
if (target.isAssignableFrom(getClass())) {
|
if (target.isAssignableFrom(getClass())) {
|
||||||
return target.cast(this);
|
return target.cast(this);
|
||||||
|
@ -344,6 +354,7 @@ public class VMTransport implements Transport, Task {
|
||||||
return location + "#" + id;
|
return location + "#" + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getRemoteAddress() {
|
public String getRemoteAddress() {
|
||||||
if (peer != null) {
|
if (peer != null) {
|
||||||
return peer.toString();
|
return peer.toString();
|
||||||
|
@ -379,34 +390,42 @@ public class VMTransport implements Transport, Task {
|
||||||
this.asyncQueueDepth = asyncQueueDepth;
|
this.asyncQueueDepth = asyncQueueDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isFaultTolerant() {
|
public boolean isFaultTolerant() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isDisposed() {
|
public boolean isDisposed() {
|
||||||
return disposed.get();
|
return disposed.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isConnected() {
|
public boolean isConnected() {
|
||||||
return !disposed.get();
|
return !disposed.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void reconnect(URI uri) throws IOException {
|
public void reconnect(URI uri) throws IOException {
|
||||||
throw new IOException("Transport reconnect is not supported");
|
throw new IOException("Transport reconnect is not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isReconnectSupported() {
|
public boolean isReconnectSupported() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isUpdateURIsSupported() {
|
public boolean isUpdateURIsSupported() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateURIs(boolean reblance,URI[] uris) throws IOException {
|
public void updateURIs(boolean reblance,URI[] uris) throws IOException {
|
||||||
throw new IOException("URI update feature not supported");
|
throw new IOException("URI update feature not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getReceiveCounter() {
|
public int getReceiveCounter() {
|
||||||
return receiveCounter;
|
return receiveCounter;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue