}
@Override
protected NetworkBridge createBridge(Transport localTransport,
Transport remoteTransport, final DiscoveryEvent event) {
final NetworkBridge next = super.createBridge(localTransport,
remoteTransport, event);
return new NetworkBridge() {
@Override
public void start() throws Exception {
next.start();
// Delay returning until the failed service has been
// removed.
removedLatch.await();
}
@Override
public void stop() throws Exception {
next.stop();
}
@Override
public void serviceRemoteException(Throwable error) {
next.serviceRemoteException(error);
}
@Override
public void serviceLocalException(Throwable error) {
next.serviceLocalException(error);
}
@Override
public void setNetworkBridgeListener(
NetworkBridgeListener listener) {
next.setNetworkBridgeListener(listener);
}
@Override
public String getRemoteAddress() {
return next.getRemoteAddress();
}
@Override
public String getRemoteBrokerName() {
return next.getRemoteBrokerName();
}
@Override
public String getRemoteBrokerId() {
return next.getRemoteBrokerId();
}
@Override
public String getLocalAddress() {
return next.getLocalAddress();
}
@Override
public String getLocalBrokerName() {
return next.getLocalBrokerName();
}
@Override
public long getEnqueueCounter() {
return next.getEnqueueCounter();
}
@Override
public long getDequeueCounter() {
return next.getDequeueCounter();
}
@Override
public void setMbeanObjectName(ObjectName objectName) {
next.setMbeanObjectName(objectName);
}
@Override
public ObjectName getMbeanObjectName() {
return next.getMbeanObjectName();
}
public void resetStats(){
next.resetStats();
}
};
}
};
nc.setDiscoveryAgent(da);