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

Thread: Remoting and long running processes

  1. #11
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    Ollie,

    behind this facade is a thread pool for running the jobs and a map from JobKey to status+executing thread of each active job.
    I was wondering what is this status you are returning. I mean is it something you persist somwhere or I guess i am wondering how to measure this as its running in some thread?

    Amad

  2. #12
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    335

    Default

    Amad,

    my example above is not an exactly copy of our system it's merely intended as a clear example of the approach we use.

    In our system the JobKey is just a String it could be an int, long or anything that uniquely identifies each job. For thread pooling we have just switched to using a Java 1.5 ExecutorService allocated using Executors.newCachedThreadPool() - if your using Java 1.4/3 there's plenty of thread pool implementations including back port of the Java 1.5 stuff.

    The job status info is updated by each job as it progresses through it's various tasks. In out system this is quite simple as we have lots of small steps which gives us lots of opportunity to update this value, however if your job is on the monolithic side you may not be able to update the status so often (an indeterminate progress bar can be a big help here)

    Ollie

  3. #13
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    if your job is on the monolithic side you may not be able to update the status so often (an indeterminate progress bar can be a big help here)
    Thats the case I am working with, so would advice aginst persisting the state of task in database or some persistent store?

    Is there anything on richclient side you are using (ActionCommand etc) that is helping you to update the client status. (i.e progress bar in status bar).

    Amad

  4. #14
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    335

    Default

    Thats the case I am working with, so would advice aginst persisting the state of task in database or some persistent store?
    If there's no way to know how long the job's going to take or how much it's progressed then attempting maintaining any progress info is pointless. Perhaps you could use the average execution time of your jobs as a base point to guess the execution time of new jobs?

    Is there anything on rich client side you are using (ActionCommand etc) that is helping you to update the client status. (i.e progress bar in status bar).
    Not really. We have a dialog that pops up showing the progress bar (which is updated by a timer thread) and a cancel button. I could imagine a much nicer solution, along the lines of Eclipse's job running system, with the ability to send jobs to the background etc. but this is not a requirement for us.

    Ollie

Posting Permissions

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