package lc.esp.engine.broker;

import lc.mecha.log.MechaLogger;
import lc.mecha.log.MechaLoggerFactory;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerFilter;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.broker.region.Destination;
import org.apache.activemq.command.ActiveMQDestination;

public class EnhancedBroker extends BrokerFilter {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(EnhancedBroker.class);

    public EnhancedBroker(Broker next) {
        super(next);
        logger.info("Created new Enhanced Broker. [broker: {}]", next);
    }

    public Destination addDestination(ConnectionContext context,
                                      ActiveMQDestination destination,
                                      boolean createIfTemporary) throws Exception {
        logger.info("Creating destination. [dst: {}]", destination);
        return super.addDestination(context, destination, createIfTemporary);
    }
}
