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
Afficher le fichier Open project: spring-projects/spring-net Class Usage Examples

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
DetectPersistenceExceptionTranslators ( IListableObjectFactory objectFactory ) : IPersistenceExceptionTranslator

Detects the petsistence exception translators in the given object factory.

Method Details

AfterPropertiesSet() public méthode

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
Résultat void

DetectPersistenceExceptionTranslators() protected méthode

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

Invoke() public méthode

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

PersistenceExceptionTranslationInterceptor() public méthode

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

PersistenceExceptionTranslationInterceptor() public méthode

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.
Résultat System

PersistenceExceptionTranslationInterceptor() public méthode

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.
Résultat System