|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xenonsoft.bridgetown.aop.transaction.support.TransactionMethodInterceptor
Transaction method interceptor class that advises a target bean.
This interceptor has the ability to inject transactional resources into
the target bean using a Java Bean property name as the key.
| BeanUtils Property Name | resource controller name | Equivalent Java Language Statement |
|---|---|---|
| payrollConnection | payrollDB | targetBean.setPayrollConnection( IResourceController ) |
| a.b(Xanadu).salesConnection | msgDB | targetBean.getA().getB("Xanadu").setSalesConnection( IResourceController ) |
| x.y[3].counterparyConnection | cptyDB | targetBean.getX().getY(3).setCounterpartyConnection( IResourceController ) |
If the inteception method returns normally then the transaction is committed.
If the interception method returns abnormally by raising an exception, then the transaction is rolled back.
Regardlessly of normal or abnormal execution, the connection is alway released after used. If the close on release flag is set, the connection will be closed.
| Field Summary | |
protected java.util.Map |
resourceControllers
A map collection of resource controllers associated by name. |
protected java.util.Map |
resourceProperties
A map collection of resource controller names associated with target bean properties. |
protected ITransactionServiceManager |
transactionManager
The transaction service manager injected into this object by the IoC container. |
protected ITransactionSession |
transactionSession
The transaction session injected into this object by the IoC container. |
| Constructor Summary | |
TransactionMethodInterceptor()
Default constructor |
|
| Method Summary | |
java.util.Map |
getResourceControllers()
Gets the map collection of resource controllers associated by name. |
java.util.Map |
getResourceProperties()
Gets the map collection of resource controller names associated with target bean properties. |
ITransactionServiceManager |
getTransactionManager()
Gets the transaction service manager |
ITransactionSession |
getTransactionSession()
Gets the transaction session |
protected void |
injectResourceControllers(java.lang.Object targetBean)
Inject the resource controller into the target bean using the supplied setter property names |
java.lang.Object |
invocation(IInterceptionContext context)
Implements / overrides invocation |
void |
setResourceControllers(java.util.Map resourceControllers)
Sets the map collection of resource controllers associated by name. |
void |
setResourceProperties(java.util.Map resourceProperties)
Sets the map collection of resource controller names associated with target bean properties. |
void |
setTransactionManager(ITransactionServiceManager transactionManager)
Sets the transaction service manager |
void |
setTransactionSession(ITransactionSession session)
Sets the transaction session |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ITransactionSession transactionSession
protected ITransactionServiceManager transactionManager
protected java.util.Map resourceControllers
protected java.util.Map resourceProperties
| Constructor Detail |
public TransactionMethodInterceptor()
| Method Detail |
public java.util.Map getResourceControllers()
public void setResourceControllers(java.util.Map resourceControllers)
resourceControllers - the new value for resourceControllerspublic java.util.Map getResourceProperties()
public void setResourceProperties(java.util.Map resourceProperties)
resourceProperties - the new value for resourcePropertiespublic ITransactionSession getTransactionSession()
public void setTransactionSession(ITransactionSession session)
session - the new value for sessionpublic ITransactionServiceManager getTransactionManager()
public void setTransactionManager(ITransactionServiceManager transactionManager)
transactionManager - the new value for transactionManager
public java.lang.Object invocation(IInterceptionContext context)
throws java.lang.Throwable
invocation in interface IMethodInterceptorcontext -
java.lang.ThrowableIMethodInterceptor.invocation(com.xenonsoft.bridgetown.aop.IInterceptionContext)protected void injectResourceControllers(java.lang.Object targetBean)
targetBean - the target bean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||