org.infinispan.query.backend
Class QueryInterceptor

java.lang.Object
  extended by org.infinispan.commands.AbstractVisitor
      extended by org.infinispan.interceptors.base.CommandInterceptor
          extended by org.infinispan.query.backend.QueryInterceptor
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
LocalQueryInterceptor

public class QueryInterceptor
extends CommandInterceptor

This interceptor will be created when the System Property "infinispan.query.indexLocalOnly" is "false"

This type of interceptor will allow the indexing of data even when it comes from other caches within a cluster.

However, if the a cache would not be putting the data locally, the interceptor will not index it.

Since:
4.0
Author:
Navin Surtani, Sanne Grinovero (C) 2011 Red Hat Inc., Marko Luksa

Field Summary
protected  ExecutorService asyncExecutor
           
protected  TransactionManager transactionManager
           
protected  TransactionSynchronizationRegistry transactionSynchronizationRegistry
           
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
configuration
 
Constructor Summary
QueryInterceptor(org.hibernate.search.spi.SearchFactoryIntegrator searchFactory)
           
 
Method Summary
 void enableClasses(Class<?>[] classes)
           
 ExecutorService getAsyncExecutor()
          Use this executor for Async operations
 KeyTransformationHandler getKeyTransformationHandler()
           
protected  Log getLog()
           
 void injectDependencies(ExecutorService e)
           
 void registerKeyTransformer(Class<?> keyClass, Class<? extends Transformer> transformerClass)
           
protected  void removeFromIndexes(Object value, Object key)
           
protected  boolean shouldModifyIndexes(InvocationContext ctx)
           
protected  void updateIndexes(Object value, Object key)
           
 Object visitClearCommand(InvocationContext ctx, ClearCommand command)
           
 Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
           
 Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command)
           
 Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command)
           
 Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command)
           
 
Methods inherited from class org.infinispan.interceptors.base.CommandInterceptor
getNext, handleDefault, hasNext, invokeNextInterceptor, setNext
 
Methods inherited from class org.infinispan.commands.AbstractVisitor
visitApplyDeltaCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transactionManager

protected TransactionManager transactionManager

transactionSynchronizationRegistry

protected TransactionSynchronizationRegistry transactionSynchronizationRegistry

asyncExecutor

protected ExecutorService asyncExecutor
Constructor Detail

QueryInterceptor

public QueryInterceptor(org.hibernate.search.spi.SearchFactoryIntegrator searchFactory)
Method Detail

getLog

protected Log getLog()
Overrides:
getLog in class CommandInterceptor

injectDependencies

public void injectDependencies(ExecutorService e)

shouldModifyIndexes

protected boolean shouldModifyIndexes(InvocationContext ctx)

getAsyncExecutor

public ExecutorService getAsyncExecutor()
Use this executor for Async operations

Returns:

visitPutKeyValueCommand

public Object visitPutKeyValueCommand(InvocationContext ctx,
                                      PutKeyValueCommand command)
                               throws Throwable
Specified by:
visitPutKeyValueCommand in interface Visitor
Overrides:
visitPutKeyValueCommand in class AbstractVisitor
Throws:
Throwable

visitRemoveCommand

public Object visitRemoveCommand(InvocationContext ctx,
                                 RemoveCommand command)
                          throws Throwable
Specified by:
visitRemoveCommand in interface Visitor
Overrides:
visitRemoveCommand in class AbstractVisitor
Throws:
Throwable

visitReplaceCommand

public Object visitReplaceCommand(InvocationContext ctx,
                                  ReplaceCommand command)
                           throws Throwable
Specified by:
visitReplaceCommand in interface Visitor
Overrides:
visitReplaceCommand in class AbstractVisitor
Throws:
Throwable

visitPutMapCommand

public Object visitPutMapCommand(InvocationContext ctx,
                                 PutMapCommand command)
                          throws Throwable
Specified by:
visitPutMapCommand in interface Visitor
Overrides:
visitPutMapCommand in class AbstractVisitor
Throws:
Throwable

visitClearCommand

public Object visitClearCommand(InvocationContext ctx,
                                ClearCommand command)
                         throws Throwable
Specified by:
visitClearCommand in interface Visitor
Overrides:
visitClearCommand in class AbstractVisitor
Throws:
Throwable

removeFromIndexes

protected void removeFromIndexes(Object value,
                                 Object key)

updateIndexes

protected void updateIndexes(Object value,
                             Object key)

enableClasses

public void enableClasses(Class<?>[] classes)

registerKeyTransformer

public void registerKeyTransformer(Class<?> keyClass,
                                   Class<? extends Transformer> transformerClass)

getKeyTransformationHandler

public KeyTransformationHandler getKeyTransformationHandler()

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.