Search in sources :

Example 1 with Config

use of org.jaffa.modules.scheduler.services.configdomain.Config in project jaffa-framework by jaffa-projects.

the class SchedulerManager method unregisterResource.

/**
 * {@inheritDoc}
 */
@Override
public void unregisterResource(Resource resource, String context, String variation) throws JAXBException, SAXException, IOException {
    Config config = JAXBHelper.unmarshalConfigFile(Config.class, resource, CONFIGURATION_SCHEMA_FILE);
    if (config.getTask() != null) {
        for (final Task schedulerTask : config.getTask()) {
            ContextKey contextKey = new ContextKey(schedulerTask.getDataBean(), resource.getURI().toString(), variation, context);
            unregisterSchedulerTask(contextKey);
        }
    }
}
Also used : Task(org.jaffa.modules.scheduler.services.configdomain.Task) ContextKey(org.jaffa.loader.ContextKey) Config(org.jaffa.modules.scheduler.services.configdomain.Config)

Example 2 with Config

use of org.jaffa.modules.scheduler.services.configdomain.Config in project jaffa-framework by jaffa-projects.

the class SchedulerManager method registerResource.

/**
 * {@inheritDoc}
 */
@Override
public void registerResource(Resource resource, String context, String variation) throws JAXBException, SAXException, IOException {
    Config config = JAXBHelper.unmarshalConfigFile(Config.class, resource, CONFIGURATION_SCHEMA_FILE);
    if (config.getTask() != null) {
        for (final Task schedulerTask : config.getTask()) {
            ContextKey contextKey = new ContextKey(schedulerTask.getDataBean(), resource.getURI().toString(), variation, context);
            registerSchedulerTask(contextKey, schedulerTask);
        }
    }
}
Also used : Task(org.jaffa.modules.scheduler.services.configdomain.Task) ContextKey(org.jaffa.loader.ContextKey) Config(org.jaffa.modules.scheduler.services.configdomain.Config)

Aggregations

ContextKey (org.jaffa.loader.ContextKey)2 Config (org.jaffa.modules.scheduler.services.configdomain.Config)2 Task (org.jaffa.modules.scheduler.services.configdomain.Task)2