C# Class Spring.Dao.Support.PersistenceExceptionTranslationInterceptor

AOP MethodInterceptor that provides persistence exception translation based on a given PersistenceExceptionTranslator.
Delegates to the given IPersistenceExceptionTranslator to translate an Exception thrown into Spring's DataAccessException hierarchy (if appropriate).
Inheritance: IMethodInterceptor, IObjectFactoryAware, IInitializingObject
Mostra file Open project: spring-projects/spring-net Class Usage Examples

Public Methods

Method Description
AfterPropertiesSet ( ) : void

Ensures that the property PersistenceExceptionTranslator has been set. Invoked by an Spring.Objects.Factory.IObjectFactory after it has injected all of an object's dependencies.

Invoke ( IMethodInvocation invocation ) : object

Return a translated exception if this is appropriate, otherwise rethrow the original exception.

PersistenceExceptionTranslationInterceptor ( ) : System

Initializes a new instance of the PersistenceExceptionTranslationInterceptor class. Needs to be configured with a PersistenceExceptionTranslator afterwards.

PersistenceExceptionTranslationInterceptor ( IListableObjectFactory objectFactory ) : System

Initializes a new instance of the PersistenceExceptionTranslationInterceptor class, autodetecting IPersistenceExceptionTranslators in the given object factory.

PersistenceExceptionTranslationInterceptor ( IPersistenceExceptionTranslator persistenceExceptionTranslator ) : System

Initializes a new instance of the PersistenceExceptionTranslationInterceptor class for the given IPersistenceExceptionTranslator

Protected Methods

Method Description
DetectPersistenceExceptionTranslators ( IListableObjectFactory objectFactory ) : IPersistenceExceptionTranslator

Detects the petsistence exception translators in the given object factory.

Method Details

AfterPropertiesSet() public method

Ensures that the property PersistenceExceptionTranslator has been set. Invoked by an Spring.Objects.Factory.IObjectFactory after it has injected all of an object's dependencies.
/// In the event of misconfiguration (such as the failure to set a /// required property) or if initialization fails. ///
public AfterPropertiesSet ( ) : void
return void

DetectPersistenceExceptionTranslators() protected method

Detects the petsistence exception translators in the given object factory.
protected DetectPersistenceExceptionTranslators ( IListableObjectFactory objectFactory ) : IPersistenceExceptionTranslator
objectFactory IListableObjectFactory The object factory for obtaining all IPersistenceExceptionTranslators.
return IPersistenceExceptionTranslator

Invoke() public method

Return a translated exception if this is appropriate, otherwise rethrow the original exception.
public Invoke ( IMethodInvocation invocation ) : object
invocation IMethodInvocation
return object

PersistenceExceptionTranslationInterceptor() public method

Initializes a new instance of the PersistenceExceptionTranslationInterceptor class. Needs to be configured with a PersistenceExceptionTranslator afterwards.
public PersistenceExceptionTranslationInterceptor ( ) : System
return System

PersistenceExceptionTranslationInterceptor() public method

Initializes a new instance of the PersistenceExceptionTranslationInterceptor class, autodetecting IPersistenceExceptionTranslators in the given object factory.
public PersistenceExceptionTranslationInterceptor ( IListableObjectFactory objectFactory ) : System
objectFactory IListableObjectFactory The object factory to obtain all IPersistenceExceptionTranslators from.
return System

PersistenceExceptionTranslationInterceptor() public method

Initializes a new instance of the PersistenceExceptionTranslationInterceptor class for the given IPersistenceExceptionTranslator
public PersistenceExceptionTranslationInterceptor ( IPersistenceExceptionTranslator persistenceExceptionTranslator ) : System
persistenceExceptionTranslator IPersistenceExceptionTranslator The persistence exception translator to use.
return System