private String getSchedulerName(final ScheduledJobDetail scheduledJobDetail) {
   final StringBuilder sb = new StringBuilder(20);
   final MifosPlatformTenant tenant = ThreadLocalContextUtil.getTenant();
   sb.append(SchedulerServiceConstants.SCHEDULER).append(tenant.getId());
   if (scheduledJobDetail.getSchedulerGroup() > 0) {
     sb.append(SchedulerServiceConstants.SCHEDULER_GROUP)
         .append(scheduledJobDetail.getSchedulerGroup());
   }
   return sb.toString();
 }
 private Scheduler getScheduler(final ScheduledJobDetail scheduledJobDetail) throws Exception {
   final String schedulername = getSchedulerName(scheduledJobDetail);
   Scheduler scheduler = this.schedulers.get(schedulername);
   if (scheduler == null) {
     int noOfThreads = SchedulerServiceConstants.DEFAULT_THREAD_COUNT;
     if (scheduledJobDetail.getSchedulerGroup() > 0) {
       noOfThreads = SchedulerServiceConstants.GROUP_THREAD_COUNT;
     }
     scheduler = createScheduler(schedulername, noOfThreads, schedulerJobListener);
     this.schedulers.put(schedulername, scheduler);
   }
   return scheduler;
 }