https://issues.apache.org/jira/browse/AMQ-3109 - show 'createdByDuplex' in advisories and web console

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1054106 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2010-12-31 12:53:07 +00:00
parent 3e15501439
commit bd49b5250a
10 changed files with 20 additions and 10 deletions

View File

@ -392,11 +392,12 @@ public class AdvisoryBroker extends BrokerFilter {
}
@Override
public void networkBridgeStarted(BrokerInfo brokerInfo) {
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
try {
if (brokerInfo != null) {
ActiveMQMessage advisoryMessage = new ActiveMQMessage();
advisoryMessage.setBooleanProperty("started", true);
advisoryMessage.setBooleanProperty("createdByDuplex", createdByDuplex);
ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic();

View File

@ -380,7 +380,7 @@ public interface Broker extends Region, Service {
ThreadPoolExecutor getExecutor();
void networkBridgeStarted(BrokerInfo brokerInfo);
void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex);
void networkBridgeStopped(BrokerInfo brokerInfo);

View File

@ -312,8 +312,8 @@ public class BrokerFilter implements Broker {
return next.getExecutor();
}
public void networkBridgeStarted(BrokerInfo brokerInfo) {
next.networkBridgeStarted(brokerInfo);
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
next.networkBridgeStarted(brokerInfo, createdByDuplex);
}
public void networkBridgeStopped(BrokerInfo brokerInfo) {

View File

@ -282,7 +282,7 @@ public class EmptyBroker implements Broker {
public void nowMasterBroker() {
}
public void networkBridgeStarted(BrokerInfo brokerInfo) {
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
}
public void networkBridgeStopped(BrokerInfo brokerInfo) {

View File

@ -313,7 +313,7 @@ public class ErrorBroker implements Broker {
throw new BrokerStoppedException(this.message);
}
public void networkBridgeStarted(BrokerInfo brokerInfo) {
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
throw new BrokerStoppedException(this.message);
}

View File

@ -322,8 +322,8 @@ public class MutableBrokerFilter implements Broker {
return getNext().getExecutor();
}
public void networkBridgeStarted(BrokerInfo brokerInfo) {
getNext().networkBridgeStarted(brokerInfo);
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
getNext().networkBridgeStarted(brokerInfo, createdByDuplex);
}
public void networkBridgeStopped(BrokerInfo brokerInfo) {

View File

@ -308,8 +308,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
localSessionInfo = new SessionInfo(localConnectionInfo, 1);
localBroker.oneway(localSessionInfo);
brokerService.getBroker().networkBridgeStarted(remoteBrokerInfo);
brokerService.getBroker().networkBridgeStarted(remoteBrokerInfo, this.createdByDuplex);
LOG.info("Network connection between " + localBroker + " and " + remoteBroker + "(" + remoteBrokerName + ") has been established.");
} else {

View File

@ -40,4 +40,8 @@ public class AdvisoryDuplexNetworkBridgeTest extends AdvisoryNetworkBridgeTest {
broker2.start();
broker2.waitUntilStarted();
}
public void assertCreatedByDuplex(boolean createdByDuplex) {
assertTrue(createdByDuplex);
}
}

View File

@ -52,6 +52,7 @@ public class AdvisoryNetworkBridgeTest extends TestCase {
assertNotNull(advisory);
assertTrue(advisory.getDataStructure() instanceof BrokerInfo);
assertTrue(advisory.getBooleanProperty("started"));
assertCreatedByDuplex(advisory.getBooleanProperty("createdByDuplex"));
broker2.stop();
broker2.waitUntilStopped();
@ -60,7 +61,10 @@ public class AdvisoryNetworkBridgeTest extends TestCase {
assertNotNull(advisory);
assertTrue(advisory.getDataStructure() instanceof BrokerInfo);
assertFalse(advisory.getBooleanProperty("started"));
}
public void assertCreatedByDuplex(boolean createdByDuplex) {
assertFalse(createdByDuplex);
}
public void createBroker1() throws Exception {

View File

@ -28,6 +28,7 @@
<tr>
<th>Remote Broker</th>
<th>Remote Address</th>
<th>Created By Duplex</th>
<th>Messages Enqueued</th>
<th>Messages Dequeued</th>
</tr>
@ -37,6 +38,7 @@
<tr>
<td>${nb.remoteBrokerName}</td>
<td>${nb.remoteAddress}</td>
<td>${nb.createdByDuplex}</td>
<td>${nb.enqueueCounter}</td>
<td>${nb.dequeueCounter}</td>
</tr>