Search in sources :

Example 16 with BridgeException

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);
    }
}
Also used : BridgeException(com.sun.messaging.bridge.api.BridgeException) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Bridge(com.sun.messaging.bridge.api.Bridge)

Aggregations

BridgeException (com.sun.messaging.bridge.api.BridgeException)16 Bridge (com.sun.messaging.bridge.api.Bridge)8 HashMap (java.util.HashMap)6 LinkedHashMap (java.util.LinkedHashMap)6 Map (java.util.Map)6 Properties (java.util.Properties)5 Message (jakarta.jms.Message)3 DupKeyException (com.sun.messaging.bridge.api.DupKeyException)2 Destination (jakarta.jms.Destination)2 JMSException (jakarta.jms.JMSException)2 MessageProducer (jakarta.jms.MessageProducer)2 HeuristicMixedException (jakarta.transaction.HeuristicMixedException)2 HeuristicRollbackException (jakarta.transaction.HeuristicRollbackException)2 RollbackException (jakarta.transaction.RollbackException)2 ArrayList (java.util.ArrayList)2 Locale (java.util.Locale)2 ConnectionFactory (com.sun.messaging.ConnectionFactory)1 AdminMessageHandler (com.sun.messaging.bridge.admin.handlers.AdminMessageHandler)1 BridgeManagerResources (com.sun.messaging.bridge.admin.resources.BridgeManagerResources)1 BridgeCmdSharedReplyData (com.sun.messaging.bridge.api.BridgeCmdSharedReplyData)1