Moving getCategoryProjects into ThrottleJobProperty for clarity.
Use proper logger idiom (contrast patch in #6).
Adding test for getCategoryProjects, since disturbingly enough if I just make it return an empty list, ThrottleQueueTaskDispatcherTest still passes!
[FIXED JENKINS-19623] Avoid getAllItems during getCategoryProjects as it checks permissions and so can be expensive, whereas QueueTaskDispatcher.canTake must be fast.
Simpler implementation that does not require a listener.
To satisfy @oleg-nenashev, using Jenkins.getItemMap trick from #6 where it is possible—for top-level jobs—falling back to a regular (permission-checking) ItemGroup.getItem where it is not—for jobs in folders.
Merge pull request #10 from jglick/slow-getCategoryProjects-JENKINS-19623

[FIXED JENKINS-19623] getCategoryProjects without permission checks