-
Notifications
You must be signed in to change notification settings - Fork 1
Basic Usage
Steve Cote edited this page Sep 8, 2015
·
1 revision
Create a simple configuration file
{
"Class": "my.Job",
}Create a simple class which implements Loader:
public class Job extends AbstractLoader implements Loader {
/**
* @see coyote.loader.AbstractLoader#configure(coyote.loader.cfg.Config)
*/
@Override
public void configure( Config cfg ) throws ConfigurationException {
// Always a good idea to call this first
super.configure( cfg );
// Now do my own configuration
}
/**
* @see coyote.loader.AbstractLoader#start()
*/
@Override
public void start() {
// Blocking call from the MAIN thread
}
/**
* @see coyote.loader.thread.ThreadJob#shutdown()
*/
@Override
public void shutdown() {
// Perform our shutdown activities first
// Now perform the super-class termination
super.shutdown();
}
}call the BootStrap
coyote.loader.BootStrap src/test/resources/test.json
The Bootstrap will load the file into a Config object and look for a Class configuration attribute. If found, it will create an instance of that class and if it is an instance Loader. configure it, start it and then shut it down.
It is that easy.