Class MemoryExchangeStore

java.lang.Object
com.predic8.membrane.core.exchangestore.AbstractExchangeStore
com.predic8.membrane.core.exchangestore.MemoryExchangeStore
All Implemented Interfaces:
ExchangeStore

public class MemoryExchangeStore extends AbstractExchangeStore
TODO: thread-safety
Description
Stores all exchanges in-memory. The Java heap will overflow if this store is used to store too many Exchanges. Use for Membrane Monitor only.
  • Constructor Details

    • MemoryExchangeStore

      public MemoryExchangeStore()
  • Method Details

    • snap

      public void snap(AbstractExchange exc, Interceptor.Flow flow)
      Description copied from interface: ExchangeStore
      Adds the current state of the exchange to the store.

      Implementations should take a snapshot of the current state of the request (or response) headers and register a body observer in which they will be called back as soon as the body has fully been received.

      If flow==REQUEST, the request is added. Elsewise, the response is added (if present).

    • remove

      public void remove(AbstractExchange exc)
    • removeAllExchanges

      public void removeAllExchanges(Rule rule)
    • getExchanges

      public AbstractExchange[] getExchanges(RuleKey ruleKey)
    • getNumberOfExchanges

      public int getNumberOfExchanges(RuleKey ruleKey)
    • getStatistics

      public StatisticCollector getStatistics(RuleKey key)
    • getAllExchanges

      public Object[] getAllExchanges()
    • getAllExchangesAsList

      public List<AbstractExchange> getAllExchangesAsList()
    • removeAllExchanges

      public void removeAllExchanges(AbstractExchange[] exchanges)