Search in sources :

Example 1 with DiagnosticContextValueProcessor

use of org.eclipse.scout.rt.platform.logger.DiagnosticContextValueProcessor 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);
}
Also used : DiagnosticContextValueProcessor(org.eclipse.scout.rt.platform.logger.DiagnosticContextValueProcessor) TransactionProcessor(org.eclipse.scout.rt.platform.transaction.TransactionProcessor) ThreadLocalProcessor(org.eclipse.scout.rt.platform.util.ThreadLocalProcessor) CallableChain(org.eclipse.scout.rt.platform.chain.callable.CallableChain) SubjectProcessor(org.eclipse.scout.rt.platform.security.SubjectProcessor)

Aggregations

CallableChain (org.eclipse.scout.rt.platform.chain.callable.CallableChain)1 DiagnosticContextValueProcessor (org.eclipse.scout.rt.platform.logger.DiagnosticContextValueProcessor)1 SubjectProcessor (org.eclipse.scout.rt.platform.security.SubjectProcessor)1 TransactionProcessor (org.eclipse.scout.rt.platform.transaction.TransactionProcessor)1 ThreadLocalProcessor (org.eclipse.scout.rt.platform.util.ThreadLocalProcessor)1