if (componentType == BeanType.STATEFUL) {
policy = new StatefulBeanManagedTxPolicy((TransactionContainer) container);
} else if (componentType == BeanType.STATELESS) {
policy = new StatelessBeanManagedTxPolicy((TransactionContainer) container);
} else if (componentType == BeanType.MESSAGE_DRIVEN) {
policy = new MessageDrivenBeanManagedTxPolicy((TransactionContainer) container);
}
} else if (componentType == BeanType.STATEFUL) {
policy = new TxRequired((TransactionContainer) container);
if (!isBeanManagedTransaction && SessionSynchronization.class.isAssignableFrom(beanClass)) {
policy = new SessionSynchronizationTxPolicy(policy);