org.jbpm.process.audit.jms

## Class AsyncAuditLogReceiver

- java.lang.Object
- - org.jbpm.process.audit.jms.AsyncAuditLogReceiver

- All Implemented Interfaces:
    javax.jms.MessageListener
  Direct Known Subclasses:
    AuditJMSProcessor, AuditJMSProcessor

      public class AsyncAuditLogReceiver
      extends Object
      implements javax.jms.MessageListener

  Asynchronous audit event receiver. Receives messages from JMS queue that it is attached to as `MessageListener`. This is the second part of asynchronous BAM support backed by JMS (producer is provide by `AsyncAuditLogProducer` class). Thus it shares the same message format that is TextMessage with Xstream serialized *Log classes (ProcessInstanceLog, NodeInstanceLog, VaraiableInstanceLog) as content. by default it uses entity manager factory and creates entity manager for each message although it provides getEntityManager method that can be overloaded by extensions to supply entity managers instead of creating it for every message. For more enterprise based solution this class can be extended by MDB implementations to provide additional details that are required by MDB such as:
  - annotations - @MessageDriven, @ActivationConfigurationProperty
  - dependency injection - inject entity manager factory or entity manager by annotating methods

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AsyncAuditLogReceiver(javax.persistence.EntityManagerFactory entityManagerFactory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.persistence.EntityManager` | `getEntityManager()`
    `javax.persistence.EntityManagerFactory` | `getEntityManagerFactory()`
    `void` | `onMessage(javax.jms.Message message)`
    `void` | `setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AsyncAuditLogReceiver

          public AsyncAuditLogReceiver(javax.persistence.EntityManagerFactory entityManagerFactory)

  - ### Method Detail

    - #### onMessage

          public void onMessage(javax.jms.Message message)

      Specified by:
        `onMessage` in interface `javax.jms.MessageListener`

    - #### getEntityManagerFactory

          public javax.persistence.EntityManagerFactory getEntityManagerFactory()

    - #### setEntityManagerFactory

          public void setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)

    - #### getEntityManager

          public javax.persistence.EntityManager getEntityManager()

Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.