package Ġcom . sand jel kov ic . dispatch d . content Ċ Ċ import Ġcom . sand jel kov ic . dispatch d . content . daemon . Content Refresh Daemon Ċ import Ġcom . sand jel kov ic . dispatch d . content . data . repository . Import Status Repository Ċ import Ġcom . sand jel kov ic . dispatch d . content . data . repository . Show Repository Ċ import Ġcom . sand jel kov ic . dispatch d . content . data . repository . Update Job Repository Ċ import Ġcom . sand jel kov ic . dispatch d . content . service .* Ċ import Ġcom . sand jel kov ic . dispatch d . content . tr akt . provider . Tr akt Media Provider Ċ import Ġcom . sand jel kov ic . dispatch d . content . tr akt . service . Tr akt Show Importer Ċ import Ġmu . K Logging Ċ import Ġorg . springframework . beans . factory . annotation . Qualifier Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . boot . context . properties . Configuration Properties Scan Ċ import Ġorg . springframework . cloud . context . config . annotation . Refresh Scope Ċ import Ġorg . springframework . context . Application Event Publisher Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . context . event . Application Event Mult ic aster Ċ import Ġorg . springframework . context . event . Simple Application Event Mult ic aster Ċ import Ġorg . springframework . core . task . Simple AsyncTask Executor Ċ import Ġorg . springframework . core . task . Task Executor Ċ import Ġorg . springframework . scheduling . annotation . Enable Async Ċ import Ġorg . springframework . scheduling . concurrent . ThreadPool Task Executor Ċ import Ġjava . util . concurrent . Executor ĊĊ Ċ /** Ċ Ġ* Ġ@ author Ġs and jel kov ic Ċ Ġ* Ġ@ date Ġ 2 6 . 1 . 1 8 . Ċ Ġ*/ Ċ @ Configuration Ċ @ Refresh Scope Ċ @ Enable Async Ċ @ Configuration Properties Scan Ċ class ĠContent Config ( ĊĠĠĠ Ġ@ Value ("\ ${ content . refresh . interval . minutes : 1 }") ĊĠĠĠ Ġvar Ġrefresh Interval : ĠInt Ċ ) Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ: ĠK Logging () ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġcontent Refresh Service ( ĊĠĠĠĠĠĠĠ Ġupdate Job Repository : ĠUpdate Job Repository , ĊĠĠĠĠĠĠĠ Ġtr akt Media Provider : ĠTr akt Media Provider , ĊĠĠĠĠĠĠĠ Ġshow Repository : ĠShow Repository , ĊĠĠĠĠĠĠĠ Ġtr akt Show Importer : ĠTr akt Show Importer , ĊĠĠĠĠĠĠĠ Ġevent Publisher : ĠApplication Event Publisher ĊĠĠĠ Ġ) Ġ= ĠContent Refresh Service ( update Job Repository , Ġtr akt Media Provider , Ġshow Repository , Ġtr akt Show Importer , Ġevent Publisher ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġimport Service ( ĊĠĠĠĠĠĠĠ Ġimport Status Repository : ĠImport Status Repository , ĊĠĠĠĠĠĠĠ Ġimporter Selection Strategy : ĠImport er Selection Strategy , ĊĠĠĠĠĠĠĠ Ġ@ Qualifier ( show Import Task Executor Bean Name ) Ġshow Import Task Executor : ĠTask Executor ĊĠĠĠ Ġ) Ġ= ĠImport Service ( import Status Repository , Ġimporter Selection Strategy , Ġshow Import Task Executor ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġimport Strategy ( show Import ers : ĠList < Show Importer >) Ġ= ĠImport er Selection Strategy ( show Import ers ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġcontent Refresh Daemon ( content Refresh Service : ĠContent Refresh Service ) Ġ= ĠContent Refresh Daemon ( content Refresh Service ) ĊĊĠĠĠ Ġ@ Bean ( name Ġ= Ġ[" thread Pool Task Executor "]) ĊĠĠĠ Ġfun Ġthread Pool Task Executor (): ĠExecutor Ġ= ĠThreadPool Task Executor () ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Executor (): ĠExecutor Ġ= ĠThreadPool Task Executor () ĊĠĠĠĠĠĠĠ Ġ. apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcore PoolSize Ġ= Ġ 2 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmax PoolSize Ġ= Ġ 1 0 ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ( name Ġ= Ġ[ content Refresh Task Executor Bean Name ]) ĊĠĠĠ Ġfun Ġcontent Refresh Task Executor (): ĠTask Executor Ġ= ĠThreadPool Task Executor () ĊĠĠĠĠĠĠĠ Ġ. apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcore PoolSize Ġ= Ġ 1 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmax PoolSize Ġ= Ġ 1 ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ( name Ġ= Ġ[ show Import Task Executor Bean Name ]) ĊĠĠĠ Ġfun Ġshow Import Task Executor (): ĠTask Executor Ġ= ĠThreadPool Task Executor () ĊĠĠĠĠĠĠĠ Ġ. apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcore PoolSize Ġ= Ġ 1 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmax PoolSize Ġ= Ġ 8 ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ( name Ġ= Ġ[ application Event Mult ic aster ]) ĊĠĠĠ Ġfun Ġsimple Application Event Mult ic aster (): ĠApplication Event Mult ic aster Ġ= ĊĠĠĠĠĠĠĠ ĠSimple Application Event Mult ic aster (). apply Ġ{ Ġset Task Executor ( Simple AsyncTask Executor ()) Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġevent Router () Ġ= ĠEvent Router () ĊĊĠĠĠ Ġ// If Ġthe Ġbean Ġis Ġdefined Ġthis Ġway , Ġit Ġcan 't Ġbe Ġused Ġfor Ġ@ RestClient Test . Ċ // ĠĠĠ Ġ@ Bean Ċ // ĠĠĠ Ġfun Ġtr akt Media Provider ( tr akt Rest Template : ĠRest Template ) Ġ= ĠDefault Tr akt Media Provider ( tr akt Rest Template ) Ċ } Ċ Ċ const Ġval Ġcontent Refresh Task Executor Bean Name Ġ= Ġ" content Refresh Task Executor " Ċ const Ġval Ġshow Import Task Executor Bean Name Ġ= Ġ" show Import Task Executor " Ċ const Ġval Ġapplication Event Mult ic aster Ġ= Ġ" application Event Mult ic aster " Ċ