@ Reference ( name = THREAD_CONTEXT_PROVIDER , service = ThreadContextProvider . class , cardinality = ReferenceCardinality . MULTIPLE , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) protected void setThreadContextProvider ( ServiceReference < ThreadContextProvider > ref ) { String threadContextProviderName = ( String ) ref . getProperty ( COMPONENT_NAME ) ; threadContextProviders . putReference ( threadContextProviderName , ref ) ; if ( Boolean . TRUE . equals ( ref . getProperty ( ThreadContextProvider . ALWAYS_CAPTURE_THREAD_CONTEXT ) ) ) alwaysEnabled . add ( threadContextProviderName ) ; }
Declarative Services method for adding a thread context provider .