Class DefaultIndexerBatchContextFactory
java.lang.Object
de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerBatchContextFactory
- All Implemented Interfaces:
IndexerBatchContextFactory<DefaultIndexerBatchContext>
public class DefaultIndexerBatchContextFactory
extends Object
implements IndexerBatchContextFactory<DefaultIndexerBatchContext>
Default implementation of
IndexerBatchContextFactory. It uses a thread local variable for storing the
context.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContext(long indexOperationId, IndexOperation indexOperation, boolean externalIndexOperation, FacetSearchConfig facetSearchConfig, IndexedType indexedType, Collection<IndexedProperty> indexedProperties) Creates a new indexer batch context and sets it as current one.protected voidvoidDestroys the current context.voiddestroyContext(Exception failureException) Destroys the current context because an exception occurred.protected voidexecuteAfterBatchErrorListeners(DefaultIndexerBatchContext batchContext) protected voidexecuteAfterBatchListeners(DefaultIndexerBatchContext batchContext) protected voidprotected voidexecuteBeforeBatchListeners(DefaultIndexerBatchContext batchContext) Returns the current context.protected List<ExtendedIndexerBatchListener>protected List<IndexerBatchListener>getListeners(DefaultIndexerBatchContext batchContext) voidInitializes the current context and executes the before batch listeners (seeIndexerBatchListener.beforeBatch(IndexerBatchContext)).voidPrepares the context and executes the after prepare context listeners (seeExtendedIndexerBatchListener.afterPrepareContext(IndexerBatchContext)).protected voidvoidsetListenersFactory(ListenersFactory listenersFactory) voidsetSessionService(SessionService sessionService)
-
Field Details
-
LISTENERS_KEY
- See Also:
-
EXTENDED_LISTENERS_KEY
- See Also:
-
-
Constructor Details
-
DefaultIndexerBatchContextFactory
public DefaultIndexerBatchContextFactory()
-
-
Method Details
-
getSessionService
-
setSessionService
-
getListenersFactory
-
setListenersFactory
-
createContext
public DefaultIndexerBatchContext createContext(long indexOperationId, IndexOperation indexOperation, boolean externalIndexOperation, FacetSearchConfig facetSearchConfig, IndexedType indexedType, Collection<IndexedProperty> indexedProperties) Description copied from interface:IndexerBatchContextFactoryCreates a new indexer batch context and sets it as current one.- Specified by:
createContextin interfaceIndexerBatchContextFactory<DefaultIndexerBatchContext>- Parameters:
indexOperationId- - the index operation idindexOperation- - the index operationexternalIndexOperation- - indicates if the index operation is externalfacetSearchConfig- - the facet search configurationindexedType- - the indexed typeindexedProperties- - the properties to index- Returns:
- the new context
-
prepareContext
Description copied from interface:IndexerBatchContextFactoryPrepares the context and executes the after prepare context listeners (seeExtendedIndexerBatchListener.afterPrepareContext(IndexerBatchContext)).- Specified by:
prepareContextin interfaceIndexerBatchContextFactory<DefaultIndexerBatchContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
initializeContext
Description copied from interface:IndexerBatchContextFactoryInitializes the current context and executes the before batch listeners (seeIndexerBatchListener.beforeBatch(IndexerBatchContext)).- Specified by:
initializeContextin interfaceIndexerBatchContextFactory<DefaultIndexerBatchContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
getContext
Description copied from interface:IndexerBatchContextFactoryReturns the current context.- Specified by:
getContextin interfaceIndexerBatchContextFactory<DefaultIndexerBatchContext>- Returns:
- the current context
-
destroyContext
Description copied from interface:IndexerBatchContextFactoryDestroys the current context. Before destroying an active context it executes the after batch listeners (seeIndexerBatchListener.afterBatch(IndexerBatchContext)).- Specified by:
destroyContextin interfaceIndexerBatchContextFactory<DefaultIndexerBatchContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
destroyContext
Description copied from interface:IndexerBatchContextFactoryDestroys the current context because an exception occurred. Before destroying an active context it executes the after batch error listeners (seeIndexerBatchListener.afterBatchError(IndexerBatchContext)).- Specified by:
destroyContextin interfaceIndexerBatchContextFactory<DefaultIndexerBatchContext>
-
executeAfterPrepareListeners
protected void executeAfterPrepareListeners(DefaultIndexerBatchContext context) throws IndexerException - Throws:
IndexerException
-
executeBeforeBatchListeners
protected void executeBeforeBatchListeners(DefaultIndexerBatchContext batchContext) throws IndexerException - Throws:
IndexerException
-
executeAfterBatchListeners
protected void executeAfterBatchListeners(DefaultIndexerBatchContext batchContext) throws IndexerException - Throws:
IndexerException
-
executeAfterBatchErrorListeners
-
getExtendedListeners
protected List<ExtendedIndexerBatchListener> getExtendedListeners(DefaultIndexerBatchContext context) -
getListeners
-
createLocalSessionContext
protected void createLocalSessionContext() -
removeLocalSessionContext
protected void removeLocalSessionContext()
-