Disable sling schedule on author | Community
Skip to main content
Level 2
September 8, 2016
Solved

Disable sling schedule on author

  • September 8, 2016
  • 6 replies
  • 3379 views

Hi,

Would like to disabled sling scheduler on author instance. We have unchecked  the check box but still its running. How to disabled on author.

 

Below is code for configuration. 

@Component(immediate = true, label = "Aadhaar Seeding Schedular for IndisInd Bank", description = "Aadhaar Seeding Schedular for IndisInd Bank", metatype = true)

@Service(value = Runnable.class)
@Properties({
        @Property(name = Constants.SERVICE_DESCRIPTION, value = "Aadhaar Seeding for IndisInd"),
        @Property(name = Constants.SERVICE_VENDOR, value = "Indigo"),
        @Property(label = "Active/Inactive : ", name = "scheduler.concurrent", boolValue = false),
        @Property(label = "Schedular Time : ", name = "scheduler.expression", value = "0 0 9 * * ?", description = "Scheduler Cron Expression. Follow the link http://www.docjar.com/docs/api/org/quartz/CronExpression.html for more details.") })

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jitendra_S_Toma

Deepak,

I don't think there is a way to enable/disabled scheduler from their properties. However, two solutions i can think of

  • You can keep scheduler running and have checkbox OSGI property at the scheduler level. And based on this property, you can decide whether you need execute rest of the code or not.
  • Another option is to write a simple supporting service which will have a checkbox OSGI property and based on chosen option you can schedule or unschedule a scheduler service. Assuming scheduler service is being registered from this supporting service not through OSGI property & cron job.

Regards,

Jitendra

6 replies

smacdonald2008
Level 10
September 8, 2016

Is this a custom sling scheduler service? 

Sham_HC
Level 10
September 9, 2016
Level 2
September 9, 2016

yes its custom 

Level 2
September 9, 2016

Thanks Sham for answer. Is there any other way of doing. can just check/uncheck to disable/enable.  

Jitendra_S_Toma
Jitendra_S_TomaAccepted solution
Level 10
September 9, 2016

Deepak,

I don't think there is a way to enable/disabled scheduler from their properties. However, two solutions i can think of

  • You can keep scheduler running and have checkbox OSGI property at the scheduler level. And based on this property, you can decide whether you need execute rest of the code or not.
  • Another option is to write a simple supporting service which will have a checkbox OSGI property and based on chosen option you can schedule or unschedule a scheduler service. Assuming scheduler service is being registered from this supporting service not through OSGI property & cron job.

Regards,

Jitendra

Level 2
September 12, 2016

Jitendra S.Tomar wrote...

Deepak,

I don't think there is a way to enable/disabled scheduler from their properties. However, two solutions i can think of

  • You can keep scheduler running and have checkbox OSGI property at the scheduler level. And based on this property, you can decide whether you need execute rest of the code or not.
  • Another option is to write a simple supporting service which will have a checkbox OSGI property and based on chosen option you can schedule or unschedule a scheduler service. Assuming scheduler service is being registered from this supporting service not through OSGI property & cron job.

Regards,

Jitendra

 

Thanks Jitendra, We have written similar code to identify the active and inactive (true /false) and based on that code is running. I had encountered  caching issue and restarted the instance and now its working fine. Thanks for your response