Refine search
@Override public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { if (isLogAll() || isLogInternalEvents()) { LOG.info("Adding destination info: {}", info); } super.addDestinationInfo(context, info); }
@Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append("LoggingBrokerPlugin("); buf.append("logAll="); buf.append(isLogAll()); buf.append(", logConnectionEvents="); buf.append(isLogConnectionEvents()); buf.append(", logSessionEvents="); buf.append(isLogSessionEvents()); buf.append(", logConsumerEvents="); buf.append(isLogConsumerEvents()); buf.append(", logProducerEvents="); buf.append(isLogProducerEvents()); buf.append(", logTransactionEvents="); buf.append(isLogTransactionEvents()); buf.append(", logInternalEvents="); buf.append(isLogInternalEvents()); buf.append(")"); return buf.toString(); }
@Override public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { if (isLogAll() || isLogInternalEvents()) { LOG.info("Removing destination info: {}", info); } super.removeDestinationInfo(context, info); }
@Override public void start() throws Exception { if (isLogAll() || isLogInternalEvents()) { LOG.info("Starting {}", getBrokerName()); } super.start(); }
@Override public void postProcessDispatch(MessageDispatch messageDispatch) { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("postProcessDispatch: {}", messageDispatch); } super.postProcessDispatch(messageDispatch); }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("ProcessDispatchNotification: {}", messageDispatchNotification); } super.processDispatchNotification(messageDispatchNotification); }
@Override public void fastProducer(ConnectionContext context, ProducerInfo producerInfo,ActiveMQDestination destination) { if (isLogAll() || isLogProducerEvents() || isLogInternalEvents()) { LOG.info("Fast Producer: {}", producerInfo); } super.fastProducer(context, producerInfo, destination); }
@Override public void nowMasterBroker() { if (isLogAll() || isLogInternalEvents()) { LOG.info("Is now the master broker: {}", getBrokerName()); } super.nowMasterBroker(); }
@Override public void addBroker(Connection connection, BrokerInfo info) { if (isLogAll() || isLogInternalEvents()) { LOG.info("Adding Broker {}", info.getBrokerName()); } super.addBroker(connection, info); }
@Override public void removeBroker(Connection connection, BrokerInfo info) { if (isLogAll() || isLogInternalEvents()) { LOG.info("Removing Broker {}", info.getBrokerName()); } super.removeBroker(connection, info); }
@Override public void preProcessDispatch(MessageDispatch messageDispatch) { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("preProcessDispatch: {}", messageDispatch); } super.preProcessDispatch(messageDispatch); }
@Override public void stop() throws Exception { if (isLogAll() || isLogInternalEvents()) { LOG.info("Stopping {}", getBrokerName()); } super.stop(); }
@Override public BrokerInfo[] getPeerBrokerInfos() { BrokerInfo[] result = super.getPeerBrokerInfos(); if (isLogAll() || isLogInternalEvents()) { if (result == null) { LOG.info("Get Peer Broker Infos returned empty list."); } else { StringBuffer peers = new StringBuffer(); for (BrokerInfo bi : result) { peers.append(peers.length() > 0 ? ", " : ""); peers.append(bi.getBrokerName()); } LOG.info("Get Peer Broker Infos: {}", peers); } } return result; }
@Override public ActiveMQDestination[] getDestinations() throws Exception { ActiveMQDestination[] result = super.getDestinations(); if (isLogAll() || isLogInternalEvents()) { if (result == null) { LOG.info("Get Destinations returned empty list."); } else { StringBuffer destinations = new StringBuffer(); for (ActiveMQDestination dest : result) { destinations.append(destinations.length() > 0 ? ", " : ""); destinations.append(dest.getPhysicalName()); } LOG.info("Get Destinations: {}", destinations); } } return result; }
@Override public Set<ActiveMQDestination> getDurableDestinations() { Set<ActiveMQDestination> result = super.getDurableDestinations(); if (isLogAll() || isLogInternalEvents()) { if (result == null) { LOG.info("Get Durable Destinations returned empty list."); } else { StringBuffer destinations = new StringBuffer(); for (ActiveMQDestination dest : result) { destinations.append(destinations.length() > 0 ? ", " : ""); destinations.append(dest.getPhysicalName()); } LOG.info("Get Durable Destinations: {}", destinations); } } return result; }
@Override public Connection[] getClients() throws Exception { Connection[] result = super.getClients(); if (isLogAll() || isLogInternalEvents()) { if (result == null) { LOG.info("Get Clients returned empty list."); } else { StringBuffer cids = new StringBuffer(); for (Connection c : result) { cids.append(cids.length() > 0 ? ", " : ""); cids.append(c.getConnectionId()); } LOG.info("Connected clients: {}", cids); } } return super.getClients(); }
@Override public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, Subscription subscription, Throwable poisonCause) { if (isLogAll() || isLogInternalEvents()) { String msg = "Unable to display message."; msg = messageReference.getMessage().toString(); LOG.info("Sending to DLQ: {}", msg); } return super.sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); }
@Override public void isFull(ConnectionContext context, Destination destination, Usage<?> usage) { if (isLogAll() || isLogProducerEvents() || isLogInternalEvents()) { LOG.info("Destination is full: {}", destination.getName()); } super.isFull(context, destination, usage); }
@Override public org.apache.activemq.broker.region.Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean create) throws Exception { if (isLogAll() || isLogInternalEvents()) { LOG.info("Adding destination: {}:{}", destination.getDestinationTypeAsString(), destination.getPhysicalName()); } return super.addDestination(context, destination, create); }
@Override public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) { if (isLogAll() || isLogInternalEvents()) { String msg = "Unable to display message."; msg = message.getMessage().toString(); LOG.info("Message has expired: {}", msg); } super.messageExpired(context, message, subscription); }