Search in sources :

Example 1 with IExchangesStoreListener

use of com.predic8.membrane.core.model.IExchangesStoreListener in project service-proxy by membrane.

the class AbstractExchangeStore method notifyListenersOnExchangeRemoval.

public void notifyListenersOnExchangeRemoval(AbstractExchange exchange) {
    for (IExchangesStoreListener listener : exchangesStoreListeners) {
        exchange.removeExchangeStoreListener(listener);
        listener.removeExchange(exchange);
    }
}
Also used : IExchangesStoreListener(com.predic8.membrane.core.model.IExchangesStoreListener)

Example 2 with IExchangesStoreListener

use of com.predic8.membrane.core.model.IExchangesStoreListener in project service-proxy by membrane.

the class AbstractExchangeStore method notifyListenersOnExchangeAdd.

public void notifyListenersOnExchangeAdd(Rule rule, AbstractExchange exchange) {
    for (IExchangesStoreListener listener : exchangesStoreListeners) {
        exchange.addExchangeStoreListener(listener);
        listener.addExchange(rule, exchange);
    }
}
Also used : IExchangesStoreListener(com.predic8.membrane.core.model.IExchangesStoreListener)

Example 3 with IExchangesStoreListener

use of com.predic8.membrane.core.model.IExchangesStoreListener in project service-proxy by membrane.

the class MemoryExchangeStore method snap.

public void snap(AbstractExchange exc, Flow flow) {
    if (flow != Flow.REQUEST)
        return;
    if (isKeyInStore(exc)) {
        getKeyList(exc).add(exc);
    } else {
        List<AbstractExchange> list = new Vector<AbstractExchange>();
        list.add(exc);
        exchangesMap.put(exc.getRule().getKey(), list);
    }
    totals.add(exc);
    for (IExchangesStoreListener listener : exchangesStoreListeners) {
        exc.addExchangeStoreListener(listener);
        listener.addExchange(exc.getRule(), exc);
    }
}
Also used : IExchangesStoreListener(com.predic8.membrane.core.model.IExchangesStoreListener) AbstractExchange(com.predic8.membrane.core.exchange.AbstractExchange) Vector(java.util.Vector)

Example 4 with IExchangesStoreListener

use of com.predic8.membrane.core.model.IExchangesStoreListener in project service-proxy by membrane.

the class MemoryExchangeStore method removeAllExchanges.

public void removeAllExchanges(Rule rule) {
    AbstractExchange[] exchanges = getExchanges(rule.getKey());
    exchangesMap.remove(rule.getKey());
    totals.removeAll(Arrays.asList(exchanges));
    for (IExchangesStoreListener listener : exchangesStoreListeners) {
        listener.removeExchanges(rule, exchanges);
    }
}
Also used : IExchangesStoreListener(com.predic8.membrane.core.model.IExchangesStoreListener) AbstractExchange(com.predic8.membrane.core.exchange.AbstractExchange)

Aggregations

IExchangesStoreListener (com.predic8.membrane.core.model.IExchangesStoreListener)4 AbstractExchange (com.predic8.membrane.core.exchange.AbstractExchange)2 Vector (java.util.Vector)1