use of org.eclipse.scout.rt.platform.transaction.TransactionProcessor in project scout.rt by eclipse.
the class RunContext method createCallableChain.
/**
* Creates the {@link CallableChain} to initialize this context, and provides basic functionality for this
* {@link RunContext}.
* <p>
* This method is not intended to be overwritten. To contribute behavior, overwrite
* {@link #interceptCallableChain(CallableChain)}. Contributions are added before setting the transaction boundary.
*/
protected <RESULT> CallableChain<RESULT> createCallableChain() {
final CallableChain<RESULT> contributions = new CallableChain<RESULT>();
interceptCallableChain(contributions);
@SuppressWarnings("unchecked") final TransactionProcessor<RESULT> transactionProcessor = BEANS.get(TransactionProcessor.class).withCallerTransaction(m_transaction).withTransactionScope(m_transactionScope).withTransactionMembers(m_transactionMembers);
return new CallableChain<RESULT>().add(new ThreadLocalProcessor<>(RunContext.CURRENT, this)).add(new ThreadLocalProcessor<>(CorrelationId.CURRENT, m_correlationId)).add(new ThreadLocalProcessor<>(RunMonitor.CURRENT, Assertions.assertNotNull(m_runMonitor))).add(new SubjectProcessor<RESULT>(m_subject)).add(new DiagnosticContextValueProcessor(BEANS.get(PrinicpalContextValueProvider.class))).add(new DiagnosticContextValueProcessor(BEANS.get(CorrelationIdContextValueProvider.class))).add(new ThreadLocalProcessor<>(NlsLocale.CURRENT, m_locale)).add(new ThreadLocalProcessor<>(PropertyMap.CURRENT, m_propertyMap)).addAll(m_threadLocalProcessors.values()).addAll(contributions.asList()).addAll(m_diagnosticProcessors.values()).add(transactionProcessor).addAll(m_interceptors);
}
Aggregations