@Test public void testUnbindMessageConsumer() throws JMSException { cntJMSConsumerMock.stop(); EasyMock.expectLastCall(); EasyMock.expect(messageConsumersMock.remove(consumerMock)).andReturn(cntJMSConsumerMock); EasyMock.replay(messageConsumersMock, cntJMSConsumerMock, jmsConsumerMock); ConsumerFactory consumerFactory = new ConsumerFactory(); consumerFactory.setProvider(providerMock); consumerFactory.setJmsMessageConsumers(messageConsumersMock); consumerFactory.unbindMessageConsumer(consumerMock); EasyMock.verify(jmsConsumerMock); }
@Unbind(aggregate = true) public void unbindMessageConsumer(ProviderMessageConsumer consumer) { JMSMessageConsumer consumerToBeRemoved = jmsMessageConsumers .remove(consumer); if (consumerToBeRemoved != null) { consumerToBeRemoved.stop(); LOG.debug("JMS message consumer has been closed"); } else { LOG.warn("JMS message consumer for the removed provider message " + "consumer was not found. ProviderMessageConsumer == " + consumer); } }
ConsumerFactory { @Unbind(aggregate = true) public void unbindMessageConsumer(ProviderMessageConsumer consumer) { JMSMessageConsumer consumerToBeRemoved = jmsMessageConsumers .remove(consumer); if (consumerToBeRemoved != null) { consumerToBeRemoved.stop(); LOG.debug("JMS message consumer has been closed"); } else { LOG.warn("JMS message consumer for the removed provider message " + "consumer was not found. ProviderMessageConsumer == " + consumer); } } }
ConsumerFactory { @Unbind(aggregate = true) public void unbindMessageConsumer(ProviderMessageConsumer consumer) { JMSMessageConsumer consumerToBeRemoved = jmsMessageConsumers .remove(consumer); if (consumerToBeRemoved != null) { consumerToBeRemoved.stop(); LOG.debug("JMS message consumer has been closed"); } else { LOG.warn("JMS message consumer for the removed provider message " + "consumer was not found. ProviderMessageConsumer == " + consumer); } }  }
ConsumerFactory { @Unbind(aggregate = true) public void unbindMessageConsumer(ProviderMessageConsumer consumer) { JMSMessageConsumer consumerToBeRemoved = jmsMessageConsumers .remove(consumer); if (consumerToBeRemoved != null) { consumerToBeRemoved.stop(); LOG.debug("JMS message consumer has been closed"); } else { LOG.warn("JMS message consumer for the removed provider message " + "consumer was not found. ProviderMessageConsumer == " + consumer); } }  @Bind(aggregate = true, optional = true) void bindMessageConsumer(ProviderMessageConsumer consumer); @Validate void init(); @Invalidate void stopConsumerFactory(); @Unbind(aggregate = true) void unbindMessageConsumer(ProviderMessageConsumer consumer); }
ConsumerFactory { @Unbind(aggregate = true) public void unbindMessageConsumer(ProviderMessageConsumer consumer) { JMSMessageConsumer consumerToBeRemoved = jmsMessageConsumers .remove(consumer); if (consumerToBeRemoved != null) { consumerToBeRemoved.stop(); LOG.debug("JMS message consumer has been closed"); } else { LOG.warn("JMS message consumer for the removed provider message " + "consumer was not found. ProviderMessageConsumer == " + consumer); } }  @Bind(aggregate = true, optional = true) void bindMessageConsumer(ProviderMessageConsumer consumer); @Validate void init(); @Invalidate void stopConsumerFactory(); @Unbind(aggregate = true) void unbindMessageConsumer(ProviderMessageConsumer consumer);  }