Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Dynamic Scheduling

  1. #11
    Join Date
    Sep 2010
    Posts
    14

    Default

    @litius

    Sure,
    We have a timer which is 3 minutes long on each auction, and counts down.

    Now I want to reset the timer when users bid on auction.

  2. #12
    Join Date
    Apr 2008
    Location
    Philadelphia, US
    Posts
    198

    Arrow

    @navid,

    Whenever you use Spring's TaskScheduler to schedule a task it follows a "java.util.concurrent.ScheduledExecutorService " convention and returns you a "java.util.concurrent.ScheduledFuture", which you can cancel as any java Future object.

    So if you keep a reference to this ScheduledFuture within the Auction / Selling Item / etc.. you can cancel it at any time. And then reschedule the task in the same way you have scheduled it in the first place.

    /Anatoly
    Humans are stateful and mutable beings that have no problems processing many things concurrently and share state with others + they are usually "coupled"

  3. #13
    Join Date
    Sep 2010
    Posts
    14

    Lightbulb

    Thanks Anatoly, I just followed your solutions and it worked for me.

    Regards

  4. #14
    Join Date
    Oct 2010
    Posts
    1

    Default

    Is "scheduler" in this example an instance of SchedulerFactoryBean ?
    I Also need to pass a parameter(auctionID) to the job, how can I make it possible in this approach?

  5. #15

    Default How to Create Job Schedule in Spring annotation

    Hi,

    I tried job schedule in spring with Quarts tools. but i want to know whether to create job schedule in spring annotation without using quartz and also should achieve in new Programmatic way apply time, schedule class and others, not for bean config...........................

  6. #16
    Join Date
    Dec 2010
    Posts
    5

    Default

    Quote Originally Posted by litius View Post
    @navid,

    a "taskScheduler" is a regular Spring's "<task:scheduler>" and "org.gitpod.scheduler.trigger.DurationTrigger" is a custom trigger. You can simply grab it form sources on github.

    If you want to pass "auctionID" as a runtime parameter, you can just rebuild the Runnable on the fly using the info from the (e.g. "shipUbuntuDvdTask") bean.

    Check the sources / tests for more examples. Let me know if you need a JAR, or you can just grab the sources, that is fine too.

    /Anatoly
    Can you please give me detailed information regarding which steps I should take if I want to pass parameters at Run-Time while scheduling a job?

  7. #17
    Join Date
    Dec 2010
    Posts
    5

    Default

    Quote Originally Posted by litius View Post
    @navid,

    Whenever you use Spring's TaskScheduler to schedule a task it follows a "java.util.concurrent.ScheduledExecutorService " convention and returns you a "java.util.concurrent.ScheduledFuture", which you can cancel as any java Future object.

    So if you keep a reference to this ScheduledFuture within the Auction / Selling Item / etc.. you can cancel it at any time. And then reschedule the task in the same way you have scheduled it in the first place.

    /Anatoly
    @Anatoly, I will really appreciate if you can guide me about "how to stop scheduler".. Thanks in advance.

  8. #18
    Join Date
    Dec 2010
    Posts
    5

    Default

    Is there anyway I can implement Dynamic Scheduling (More like a CronTrigger which will be invoked based on the information stored in the database) ??

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •