use of com.sun.messaging.bridge.api.BridgeException in project openmq by eclipse-ee4j.
the class BridgeServiceManagerImpl method stopBridge.
public synchronized void stopBridge(String name, String[] args, String type) throws Exception {
if (type != null && !type.equals(Bridge.JMS_TYPE) && !type.equals(Bridge.STOMP_TYPE)) {
throw new IllegalArgumentException(_bmr.getKString(_bmr.X_BRIDGE_INVALID_TYPE, type));
}
Bridge b = null;
if (name != null) {
b = _bridges.get(name);
if (b == null) {
throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_NAME_NOT_FOUND, name));
}
if (type != null && !type.equals(b.getType())) {
String[] eparam = new String[] { name, b.getType(), type };
throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_TYPE_MISMATCH, eparam));
}
stopBridge(b, args);
return;
}
for (Map.Entry<String, Bridge> pair : _bridges.entrySet()) {
b = pair.getValue();
if (type != null && !b.getType().equals(type)) {
continue;
}
stopBridge(b, args);
}
}
Aggregations