There are references to services we use only via the router and we need those routes up, it is import to explicitly define a @Reference to the RouteService with a target filter of that particular service/route we expect/need to be on the router before the service doing the referencing can do anything useful. Makes dependencies more concrete.
See the class SchedulerService.java to see how we make use of this facility. The example is that the SchedulerService needs there to be a route for both the repo/ and for the policy/
@Reference(name = "ref_SchedulerService_PolicyService",
target = "(" + ServerConstants.ROUTER_PREFIX + "=/policy*)")
private RouteService policy;
The RepoJobStore will attempt to get/create trigger group names by making calls on the router - see
RepoJobStore#getTriggerGroupNames, which is ultimately called when this service is activated. This reference insures
that the repo service implementation has been registered with the router prior to the activation of this service.
@Reference(name = "ref_SchedulerService_RepoService", target = "(" + ServerConstants.ROUTER_PREFIX + "=/repo/*)")
private RouteService repoService;