org.springframework.data.hadoop.hbase
Class HbaseInterceptor

java.lang.Object
  extended by org.springframework.data.hadoop.hbase.HbaseAccessor
      extended by org.springframework.data.hadoop.hbase.HbaseInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, InitializingBean

public class HbaseInterceptor
extends HbaseAccessor
implements org.aopalliance.intercept.MethodInterceptor

AOP interceptor that binds a new Hbase table to the thread before a method call, closing and removing it afterwards in case of any method outcome. If there is already a pre-bound table (from a previous call or transaction), the interceptor simply participates in it. Typically used alongside HbaseSynchronizationManager.

Author:
Costin Leau

Constructor Summary
HbaseInterceptor()
           
 
Method Summary
 void afterPropertiesSet()
           
 Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
           
 void setExceptionConversionEnabled(boolean exceptionConversionEnabled)
          Sets whether to convert any IOException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.
 void setTableNames(String[] tableNames)
           
 
Methods inherited from class org.springframework.data.hadoop.hbase.HbaseAccessor
getCharset, getConfiguration, getTableFactory, setConfiguration, setEncoding, setTableFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HbaseInterceptor

public HbaseInterceptor()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class HbaseAccessor

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable

setTableNames

public void setTableNames(String[] tableNames)

setExceptionConversionEnabled

public void setExceptionConversionEnabled(boolean exceptionConversionEnabled)
Sets whether to convert any IOException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.

Default is "true". Turn this flag off to let the caller receive raw exceptions as-is, without any wrapping.

See Also:
DataAccessException