org.hibernate.search.backend.jms.impl

## Class JmsBackendQueueProcessor

- java.lang.Object
- - org.hibernate.search.backend.jms.impl.JmsBackendQueueProcessor

- All Implemented Interfaces:
    BackendQueueProcessor, BackendQueueProcessor.Transactional
  Direct Known Subclasses:
    JndiJMSBackendQueueProcessor

      public abstract class JmsBackendQueueProcessor
      extends Object
      implements BackendQueueProcessor, BackendQueueProcessor.Transactional

  Backend sending the workload via JMS. Optionally support transactions: the JMS messages can be sent as part of the current transaction.
  Author:
    Emmanuel Bernard, Hardy Ferentschik, Sanne Grinovero (C) 2011 Red Hat Inc., Yoann Gendre

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.hibernate.search.backend.spi.BackendQueueProcessor

      `BackendQueueProcessor.Transactional`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `JMS_CONNECTION_FACTORY`
    `static String` | `JMS_CONNECTION_LOGIN`
    `static String` | `JMS_CONNECTION_PASSWORD`
    `static String` | `JMS_QUEUE`
    `protected static String` | `JNDI_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JmsBackendQueueProcessor()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `applyStreamWork(LuceneWork singleOperation, IndexingMonitor monitor)` Applies a single operation on the index, and different operations can be applied in parallel, even in parallel to a workList instance being processed by `BackendQueueProcessor.applyWork(List, IndexingMonitor)`
    `void` | `applyWork(List<LuceneWork> workList, IndexingMonitor monitor)` Applies a list of operations to the index.
    `void` | `close()` Used to shutdown and eventually release resources.
    `String` | `getIndexName()`
    `javax.jms.QueueConnection` | `getJMSConnection()`
    `javax.jms.Queue` | `getJmsQueue()`
    `String` | `getJmsQueueName()`
    `SearchIntegrator` | `getSearchIntegrator()`
    `ServiceManager` | `getServiceManager()`
    `void` | `initialize(Properties props, WorkerBuildContext context, IndexManager indexManager)` Used at startup, called once as first method.
    `protected abstract javax.jms.QueueConnection` | `initializeJMSConnection(javax.jms.QueueConnectionFactory factory, Properties props)` Initialises the JMS QueueConnection to be used for sending Lucene work operations to the master node.
    `protected abstract javax.jms.Queue` | `initializeJMSQueue(javax.jms.QueueConnectionFactory factory, Properties props)` Initialises the JMS queue to be used for sending Lucene work operations to the master node.
    `protected abstract javax.jms.QueueConnectionFactory` | `initializeJMSQueueConnectionFactory(Properties props)` Initialises the JMS QueueConnectionFactory to be used for sending Lucene work operations to the master node.
    `boolean` | `isTransactional()`
    `void` | `releaseJMSConnection(javax.jms.QueueConnection queueConnection)`

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

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

- - ### Field Detail

    - #### JNDI_PREFIX

          protected static final String JNDI_PREFIX

      See Also:
        Constant Field Values

    - #### JMS_CONNECTION_FACTORY

          public static final String JMS_CONNECTION_FACTORY

      See Also:
        Constant Field Values

    - #### JMS_QUEUE

          public static final String JMS_QUEUE

      See Also:
        Constant Field Values

    - #### JMS_CONNECTION_LOGIN

          public static final String JMS_CONNECTION_LOGIN

      See Also:
        Constant Field Values

    - #### JMS_CONNECTION_PASSWORD

          public static final String JMS_CONNECTION_PASSWORD

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JmsBackendQueueProcessor

          public JmsBackendQueueProcessor()

  - ### Method Detail

    - #### initialize

          public void initialize(Properties props,
                                 WorkerBuildContext context,
                                 IndexManager indexManager)

      Description copied from interface: `BackendQueueProcessor`
      Used at startup, called once as first method.
      Specified by:
        `initialize` in interface `BackendQueueProcessor`
      Parameters:
        `props` - all configuration properties
        `context` - context giving access to required meta data
        `indexManager` - the index it is related to.

    - #### getJmsQueue

          public javax.jms.Queue getJmsQueue()

    - #### applyWork

          public void applyWork(List<LuceneWork> workList,
                                IndexingMonitor monitor)

      Description copied from interface: `BackendQueueProcessor`
      Applies a list of operations to the index. A single list might be processed by applying elements in parallel threads, but no work should be started on a new workList until the previous one was fully processed. Work could be applied asynchronously according to capabilities and configuration of implementor. A null parameter is not acceptable, implementations should throw an IllegalArgumentException.
      Specified by:
        `applyWork` in interface `BackendQueueProcessor`
      Parameters:
        `workList` - list of Lucene work instance which need to be applied to the index
        `monitor` - a `IndexingMonitor` object.

    - #### applyStreamWork

          public void applyStreamWork(LuceneWork singleOperation,
                                      IndexingMonitor monitor)

      Description copied from interface: `BackendQueueProcessor`
      Applies a single operation on the index, and different operations can be applied in parallel, even in parallel to a workList instance being processed by `BackendQueueProcessor.applyWork(List, IndexingMonitor)`
      Specified by:
        `applyStreamWork` in interface `BackendQueueProcessor`
      Parameters:
        `singleOperation` - single Lucene work instance to be applied to the index
        `monitor` - a `IndexingMonitor` object.

    - #### getJMSConnection

          public javax.jms.QueueConnection getJMSConnection()

    - #### releaseJMSConnection

          public void releaseJMSConnection(javax.jms.QueueConnection queueConnection)

    - #### close

          public void close()

      Description copied from interface: `BackendQueueProcessor`
      Used to shutdown and eventually release resources. No other method should be used after this one.
      Specified by:
        `close` in interface `BackendQueueProcessor`

    - #### initializeJMSQueueConnectionFactory

          protected abstract javax.jms.QueueConnectionFactory initializeJMSQueueConnectionFactory(Properties props)

      Initialises the JMS QueueConnectionFactory to be used for sending Lucene work operations to the master node.
      Parameters:
        `props` - a `Properties` object.
      Returns:
        the initialized `QueueConnectionFactory`

    - #### initializeJMSQueue

          protected abstract javax.jms.Queue initializeJMSQueue(javax.jms.QueueConnectionFactory factory,
                                                                Properties props)

      Initialises the JMS queue to be used for sending Lucene work operations to the master node. Invoked after `initializeJMSQueueConnectionFactory(Properties)`
      Parameters:
        `factory` - a `QueueConnectionFactory` object.
        `props` - a `Properties` object.
      Returns:
        the initialized `Queue`

    - #### initializeJMSConnection

          protected abstract javax.jms.QueueConnection initializeJMSConnection(javax.jms.QueueConnectionFactory factory,
                                                                               Properties props)

      Initialises the JMS QueueConnection to be used for sending Lucene work operations to the master node. This is invoked after `initializeJMSQueue(QueueConnectionFactory, Properties)`.
      Parameters:
        `factory` - a `QueueConnectionFactory` object.
        `props` - a `Properties` object.
      Returns:
        the initialized `QueueConnection`

    - #### getJmsQueueName

          public final String getJmsQueueName()

    - #### getIndexName

          public final String getIndexName()

    - #### getSearchIntegrator

          public final SearchIntegrator getSearchIntegrator()

    - #### isTransactional

          public final boolean isTransactional()

    - #### getServiceManager

          public final ServiceManager getServiceManager()

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved