/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ActiveMQMessage(); }
@Override public Message copy() { ActiveMQMessage copy = new ActiveMQMessage(); copy(copy); return copy; }
/** * Creates an ActiveMQMessage. * * @return ActiveMQMessage */ protected ActiveMQMessage createMessage() { return new ActiveMQMessage(); }
protected void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception { ActiveMQMessage advisoryMessage = new ActiveMQMessage(); fireAdvisory(context, topic, command, targetConsumerId, advisoryMessage); }
/** * Creates a <CODE>Message</CODE> object. The <CODE>Message</CODE> * interface is the root interface of all JMS messages. A * <CODE>Message</CODE> object holds all the standard message header * information. It can be sent when a message containing only header * information is sufficient. * * @return an ActiveMQMessage * @throws JMSException if the JMS provider fails to create this message due * to some internal error. */ @Override public Message createMessage() throws JMSException { ActiveMQMessage message = new ActiveMQMessage(); configureMessage(message); return message; }
protected void fireConsumerAdvisory(ConnectionContext context, ActiveMQDestination consumerDestination, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception { ActiveMQMessage advisoryMessage = new ActiveMQMessage(); int count = 0; Set<Destination> set = getDestinations(consumerDestination); if (set != null) { for (Destination dest : set) { count += dest.getDestinationStatistics().getConsumers().getCount(); } } advisoryMessage.setIntProperty(AdvisorySupport.MSG_PROPERTY_CONSUMER_COUNT, count); fireAdvisory(context, topic, command, targetConsumerId, advisoryMessage); }
protected void fireProducerAdvisory(ConnectionContext context, ActiveMQDestination producerDestination, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception { ActiveMQMessage advisoryMessage = new ActiveMQMessage(); int count = 0; if (producerDestination != null) { Set<Destination> set = getDestinations(producerDestination); if (set != null) { for (Destination dest : set) { count += dest.getDestinationStatistics().getProducers().getCount(); } } } advisoryMessage.setIntProperty("producerCount", count); fireAdvisory(context, topic, command, targetConsumerId, advisoryMessage); }
@Override public void networkBridgeStopped(BrokerInfo brokerInfo) { try { if (brokerInfo != null) { ActiveMQMessage advisoryMessage = new ActiveMQMessage(); advisoryMessage.setBooleanProperty("started", false); networkBridges.remove(brokerInfo); ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic(); ConnectionContext context = new ConnectionContext(); context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); context.setBroker(getBrokerService().getBroker()); fireAdvisory(context, topic, brokerInfo, null, advisoryMessage); } } catch (Exception e) { handleFireFailure("network bridge stopped", e); } }
@Override public void fastProducer(ConnectionContext context, ProducerInfo producerInfo, ActiveMQDestination destination) { super.fastProducer(context, producerInfo, destination); try { if (!AdvisorySupport.isAdvisoryTopic(destination)) { ActiveMQTopic topic = AdvisorySupport.getFastProducerAdvisoryTopic(destination); ActiveMQMessage advisoryMessage = new ActiveMQMessage(); advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_PRODUCER_ID, producerInfo.getProducerId().toString()); fireAdvisory(context, topic, producerInfo, null, advisoryMessage); } } catch (Exception e) { handleFireFailure("fast producer", e); } }
@Override public void nowMasterBroker() { super.nowMasterBroker(); try { ActiveMQTopic topic = AdvisorySupport.getMasterBrokerAdvisoryTopic(); ActiveMQMessage advisoryMessage = new ActiveMQMessage(); ConnectionContext context = new ConnectionContext(); context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); context.setBroker(getBrokerService().getBroker()); fireAdvisory(context, topic, null, null, advisoryMessage); } catch (Exception e) { handleFireFailure("now master broker", e); } }
@Override public void isFull(ConnectionContext context, Destination destination, Usage<?> usage) { super.isFull(context, destination, usage); if (AdvisorySupport.isAdvisoryTopic(destination.getActiveMQDestination()) == false) { try { ActiveMQTopic topic = AdvisorySupport.getFullAdvisoryTopic(destination.getActiveMQDestination()); ActiveMQMessage advisoryMessage = new ActiveMQMessage(); advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_USAGE_NAME, usage.getName()); advisoryMessage.setLongProperty(AdvisorySupport.MSG_PROPERTY_USAGE_COUNT, usage.getUsage()); fireAdvisory(context, topic, null, null, advisoryMessage); } catch (Exception e) { handleFireFailure("is full", e); } } }
@Override public void slowConsumer(ConnectionContext context, Destination destination, Subscription subs) { super.slowConsumer(context, destination, subs); try { if (!AdvisorySupport.isAdvisoryTopic(destination.getActiveMQDestination())) { ActiveMQTopic topic = AdvisorySupport.getSlowConsumerAdvisoryTopic(destination.getActiveMQDestination()); ActiveMQMessage advisoryMessage = new ActiveMQMessage(); advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_CONSUMER_ID, subs.getConsumerInfo().getConsumerId().toString()); fireAdvisory(context, topic, subs.getConsumerInfo(), null, advisoryMessage); } } catch (Exception e) { handleFireFailure("slow consumer", e); } }