torquebox/torquebox — pull request #146 by goldmann (2013-03-18 13:07:02+00:00)
Title: [TORQUE-674] Allow runtime scheduling of jobs

Fixes https://issues.jboss.org/browse/TORQUE-674

This PR adds support for scheduling jobs at runtime:

```ruby
TorqueBox::ScheduledJob.schedule('SomeJob', "*/10 * * * * ?")
TorqueBox::ScheduledJob.schedule('SomeJob', "*/10 * * * * ?", :name => "somejob", :description => "A simple job", :singleton => true, :timeout => "5s")
```

The job name is required, but if do not specify it a default vaule of
'default' will be used. Please note that there cannot be two jobs with
the same name for one deployment unit (application).

More technical stuff:

This commit removes usage of BaseRubyComponentInstaller and moves all
the still required method to a ComponentResolverHelper helper class to
use them also in services that modify services at runtime.

A new JobSchedulizer class was introduced which is responsible for
runtime jobs scheduling.

RubyJobProxyFactory was removed and the logic was moved to
BaseJobScheduler.

JobComponentResolverInstaller was removed, since we initialize component
resolvers at runtime now (see ComponentResolverHelper and
JobSchedulizer).

In JobSchedulerInstaller we install one or two JobSchedulers depending
on the environment. One in case of a regular, non-clustered environemnt,
two (a regular and a singleton one) in case we have a clustered
environment.

PR includes also documentation and integration tests.

This PR adds also the functionality of removing scheduled jobs at runtime.

Please let me know if you want to have it squashed into one commit.