test_class.declarator: EVENTS_TOPIC = "Events"
test_class.modifier: private static final
test_class.original_string: private static final String EVENTS_TOPIC = "Events";
test_class.type: String
test_class.var_name: EVENTS_TOPIC
test_class.declarator: appender
test_class.modifier: private
test_class.original_string: private JMSAppender appender;
test_class.type: JMSAppender
test_class.var_name: appender
test_class.declarator: broker
test_class.modifier: private static
test_class.original_string: private static BrokerService broker;
test_class.type: BrokerService
test_class.var_name: broker
test_class.file: logging/jms-appender/src/test/java/org/apache/servicemix/logging/jms/JMSAppenderTest.java
test_class.identifier: JMSAppenderTest
test_class.superclass: extends CamelTestSupport
test_case.body: @Test
      public void testLogstashAppender() throws InterruptedException {
          MockEndpoint events = getMockEndpoint("mock:events");
          events.expectedMessageCount(1);
  
          appender.doAppend(MockEvents.createInfoEvent());
  
          assertMockEndpointsSatisfied();
      }
test_case.class_method_signature: JMSAppenderTest.testLogstashAppender()
test_case.full_signature: @Test public void testLogstashAppender()
test_case.identifier: testLogstashAppender
test_case.invocations: getMockEndpoint expectedMessageCount doAppend createInfoEvent assertMockEndpointsSatisfied
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLogstashAppender()
focal_class.declarator: PACKAGE = JMSAppender.class.getPackage().getName()
focal_class.modifier: private static final
focal_class.original_string: private static final String PACKAGE = JMSAppender.class.getPackage().getName();
focal_class.type: String
focal_class.var_name: PACKAGE
focal_class.declarator: LOG = LoggerFactory.getLogger(JMSAppender.class)
focal_class.modifier: private static final transient
focal_class.original_string: private static final transient Logger LOG = LoggerFactory.getLogger(JMSAppender.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: DEFAULT_EVENT_FORMAT = "default"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_EVENT_FORMAT = "default";
focal_class.type: String
focal_class.var_name: DEFAULT_EVENT_FORMAT
focal_class.declarator: LOGSTASH_EVENT_FORMAT = "logstash"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOGSTASH_EVENT_FORMAT = "logstash";
focal_class.type: String
focal_class.var_name: LOGSTASH_EVENT_FORMAT
focal_class.declarator: jmsConnectionFactory
focal_class.modifier: private
focal_class.original_string: private ConnectionFactory jmsConnectionFactory;
focal_class.type: ConnectionFactory
focal_class.var_name: jmsConnectionFactory
focal_class.declarator: connection
focal_class.modifier: private
focal_class.original_string: private Connection connection;
focal_class.type: Connection
focal_class.var_name: connection
focal_class.declarator: session
focal_class.modifier: private
focal_class.original_string: private Session session;
focal_class.type: Session
focal_class.var_name: session
focal_class.declarator: producer
focal_class.modifier: private
focal_class.original_string: private MessageProducer producer;
focal_class.type: MessageProducer
focal_class.var_name: producer
focal_class.declarator: destinationName
focal_class.modifier: private
focal_class.original_string: private String destinationName;
focal_class.type: String
focal_class.var_name: destinationName
focal_class.declarator: format = new DefaultLoggingEventFormat()
focal_class.modifier: private
focal_class.original_string: private LoggingEventFormat format = new DefaultLoggingEventFormat();
focal_class.type: LoggingEventFormat
focal_class.var_name: format
focal_class.declarator: executor = Executors.newSingleThreadExecutor()
focal_class.modifier: private
focal_class.original_string: private  ExecutorService executor = Executors.newSingleThreadExecutor();
focal_class.type: ExecutorService
focal_class.var_name: executor
focal_class.file: logging/jms-appender/src/main/java/org/apache/servicemix/logging/jms/JMSAppender.java
focal_class.identifier: JMSAppender
focal_class.interfaces: implements PaxAppender
focal_class.class_method_signature: JMSAppender.close()
focal_class.full_signature: public void close()
focal_class.identifier: close
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: JMSAppender.onBind(ConnectionFactory service)
focal_class.full_signature: public void onBind(ConnectionFactory service)
focal_class.identifier: onBind
focal_class.modifiers: public
focal_class.parameters: (ConnectionFactory service)
focal_class.return: void
focal_class.signature: void onBind(ConnectionFactory service)
focal_class.class_method_signature: JMSAppender.onUnbind(ConnectionFactory service)
focal_class.full_signature: public void onUnbind(ConnectionFactory service)
focal_class.identifier: onUnbind
focal_class.modifiers: public
focal_class.parameters: (ConnectionFactory service)
focal_class.return: void
focal_class.signature: void onUnbind(ConnectionFactory service)
focal_class.class_method_signature: JMSAppender.doAppend(final PaxLoggingEvent paxLoggingEvent)
focal_class.full_signature: public void doAppend(final PaxLoggingEvent paxLoggingEvent)
focal_class.identifier: doAppend
focal_class.modifiers: public
focal_class.parameters: (final PaxLoggingEvent paxLoggingEvent)
focal_class.return: void
focal_class.signature: void doAppend(final PaxLoggingEvent paxLoggingEvent)
focal_class.class_method_signature: JMSAppender.exclude(PaxLoggingEvent event)
focal_class.full_signature: private static boolean exclude(PaxLoggingEvent event)
focal_class.identifier: exclude
focal_class.modifiers: private static
focal_class.parameters: (PaxLoggingEvent event)
focal_class.return: boolean
focal_class.signature: boolean exclude(PaxLoggingEvent event)
focal_class.class_method_signature: JMSAppender.startsWith(String string, String start)
focal_class.full_signature: private static boolean startsWith(String string, String start)
focal_class.identifier: startsWith
focal_class.modifiers: private static
focal_class.parameters: (String string, String start)
focal_class.return: boolean
focal_class.signature: boolean startsWith(String string, String start)
focal_class.class_method_signature: JMSAppender.setJmsConnectionFactory(ConnectionFactory jmsConnectionFactory)
focal_class.full_signature: public void setJmsConnectionFactory(ConnectionFactory jmsConnectionFactory)
focal_class.identifier: setJmsConnectionFactory
focal_class.modifiers: public
focal_class.parameters: (ConnectionFactory jmsConnectionFactory)
focal_class.return: void
focal_class.signature: void setJmsConnectionFactory(ConnectionFactory jmsConnectionFactory)
focal_class.class_method_signature: JMSAppender.setDestinationName(String destinationName)
focal_class.full_signature: public void setDestinationName(String destinationName)
focal_class.identifier: setDestinationName
focal_class.modifiers: public
focal_class.parameters: (String destinationName)
focal_class.return: void
focal_class.signature: void setDestinationName(String destinationName)
focal_class.class_method_signature: JMSAppender.setFormat(String name)
focal_class.full_signature: public void setFormat(String name)
focal_class.identifier: setFormat
focal_class.modifiers: public
focal_class.parameters: (String name)
focal_class.return: void
focal_class.signature: void setFormat(String name)
focal_class.class_method_signature: JMSAppender.getOrCreateConnection()
focal_class.full_signature: protected Connection getOrCreateConnection()
focal_class.identifier: getOrCreateConnection
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Connection
focal_class.signature: Connection getOrCreateConnection()
focal_class.class_method_signature: JMSAppender.getOrCreateSession()
focal_class.full_signature: protected Session getOrCreateSession()
focal_class.identifier: getOrCreateSession
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Session
focal_class.signature: Session getOrCreateSession()
focal_class.class_method_signature: JMSAppender.getOrCreatePublisher()
focal_class.full_signature: protected MessageProducer getOrCreatePublisher()
focal_class.identifier: getOrCreatePublisher
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: MessageProducer
focal_class.signature: MessageProducer getOrCreatePublisher()
focal_class.class_method_signature: JMSAppender.closeJMSResources()
focal_class.full_signature: private void closeJMSResources()
focal_class.identifier: closeJMSResources
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void closeJMSResources()
focal_class.class_method_signature: JMSAppender.close(Object obj)
focal_class.full_signature: private static void close(Object obj)
focal_class.identifier: close
focal_class.modifiers: private static
focal_class.parameters: (Object obj)
focal_class.return: void
focal_class.signature: void close(Object obj)
focal_method.body: public void doAppend(final PaxLoggingEvent paxLoggingEvent) {
          if (exclude(paxLoggingEvent) || jmsConnectionFactory == null) {
              return;
          }
          Runnable worker = new Runnable() {
              public void run() {
                  try {
                      // Send message to the destination
                      TextMessage message = getOrCreateSession().createTextMessage();
                      message.setText(format.toString(paxLoggingEvent));
                      MessageProducer producer = getOrCreatePublisher();
                      producer.send(message);
                  } catch (JMSException e) {
                      LOG.warn("Exception caught while sending log event - reinitializing JMS resources to recover",e);
                      closeJMSResources();
                  }
              }
          };
          executor.execute(worker);
      }
focal_method.class_method_signature: JMSAppender.doAppend(final PaxLoggingEvent paxLoggingEvent)
focal_method.full_signature: public void doAppend(final PaxLoggingEvent paxLoggingEvent)
focal_method.identifier: doAppend
focal_method.invocations: exclude createTextMessage getOrCreateSession setText toString getOrCreatePublisher send warn closeJMSResources execute
focal_method.modifiers: public
focal_method.parameters: (final PaxLoggingEvent paxLoggingEvent)
focal_method.return: void
focal_method.signature: void doAppend(final PaxLoggingEvent paxLoggingEvent)