1
votes

I am using spring 3.0.7 and some scheduled jobs:

public class TestScheduler implements Runnable{

private String someValue;

public void setSomeValue(String someValue) {
        this.someValue= someValue;
    }

@Override
public void run(){
    LOGGER.info("Some value: " + this.someValue);
}

Configuration:

<property name="someValue" value="${config.someValue}"/>

The value ${config.someValue} is defined in a config.properties file. I would like to be able to read the value on this config file every time the scheduled job is executing the run() method, so I don´t have to restart the server every time I change the value of the variable I want to print.

Is there any procedure to do it? I have been reading about @BeforeJob annotation, but I don´t know how could I apply it on scheduled jobs, since the documentation I read is based on JobExecution.

Thanks in advance

1

1 Answers

0
votes

I will use this approach: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/dynamic-language.html

So I could have my configuration files, change it and automatically they will be catched.