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);
} else {
policy = new StatefulContainerManagedTxPolicy(policy);
}
} else {
// default transaction policy is required
policy = new TxRequired((TransactionContainer) container);
}
methodTransactionPolicies.put(method, policy);
}
if (policy == null) {
policy = new TxSupports((TransactionContainer) container);