Throw an exception if advisory messages are disabled when creating networks

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@646409 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-04-09 15:41:33 +00:00
parent 6b6cdaee34
commit 8bf9c17dd9
1 changed files with 3 additions and 0 deletions

View File

@ -272,6 +272,9 @@ public class BrokerService implements Service {
* @throws Exception
*/
public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception {
if (!isAdvisorySupport()) {
throw new javax.jms.IllegalStateException("Networks require advisory messages to function - advisories are currently disabled");
}
NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress);
return addNetworkConnector(connector);
}