jrun.ejb.interceptors
Class TransactionInterceptor
jrunx.kernel.ServiceAdapter
|
+--jrun.ejb.interceptors.AbstractInterceptor
|
+--jrun.ejb.interceptors.TransactionInterceptor
- All Implemented Interfaces:
- Interceptor, InterceptorMBean, javax.naming.Referenceable, java.io.Serializable, Service, ServiceMBean, TransactionInterceptorMBean
- Direct Known Subclasses:
- ContainerManagedTransactionInterceptor
- public class TransactionInterceptor
- extends AbstractInterceptor
- implements TransactionInterceptorMBean
The base XA-aware Interceptor for EJB containers. This interceptor
is added directly to containers that make use of bean-managed
transactions. One purpose of this interceptor is to suspend client
transactions before invoking a bean method and resuming the client
transaction afterwards. Another purpose is to properly affect the
outcome of bean-managed transactions according to Exceptions that
may be thrown during the course of the EJB invocation.
Containers with Container-Managed transactions do not directly use
this interceptor, but instead make use of its
ContainerManagedTransaction subclass.
- Author:
- PS Neville, Paul Reilly
- See Also:
- Serialized Form
|
Field Summary |
static java.lang.String |
OBJECT_NAME
|
protected javax.transaction.TransactionManager |
tm
|
| Fields inherited from class jrunx.kernel.ServiceAdapter |
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER |
| Methods inherited from class jrunx.kernel.ServiceAdapter |
bind, destroy, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, init, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, stop, toString, unbind, unscheduleRunnable, updateStatus |
| Methods inherited from interface jrunx.kernel.ServiceMBean |
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind |
tm
protected javax.transaction.TransactionManager tm
OBJECT_NAME
public static final java.lang.String OBJECT_NAME
TransactionInterceptor
public TransactionInterceptor(EJBContainer ejbContainer)
start
public void start()
throws java.lang.Exception
- Description copied from class:
ServiceAdapter
- Every service other than mere data collections should start
- Specified by:
start in interface Service- Overrides:
start in class ServiceAdapter
invokeHomeMethod
public java.lang.Object invokeHomeMethod(EJBInvocation ejbInvocation)
throws java.lang.Exception
- Home method ejbInvocations require transactional creates.
- Overrides:
invokeHomeMethod in class AbstractInterceptor
invokeObjectMethod
public java.lang.Object invokeObjectMethod(EJBInvocation ejbInvocation)
throws java.lang.Exception
- Invoke the EJBObject method within the specified transaction parameters.
- Overrides:
invokeObjectMethod in class AbstractInterceptor
invokeTransactedMethod
protected java.lang.Object invokeTransactedMethod(EJBInvocation ejbInvocation,
boolean isHomeMethod)
throws java.lang.Exception
handleTransactionException
protected void handleTransactionException(java.lang.Exception e,
EJBInvocation ejbInvocation)
throws java.lang.Exception
- Ensure that certain Exceptions cause any active TX to be marked
for rollback only.
Copyright � 2002 Macromedia Corporation. All Rights Reserved.