Deltaspike + Quartz + CronExpressions from custom property file
<p>I've achieved configuring CronExpression from a propery file, but this property file is apache-deltaspike.properties, which is inside the .jar file. I need to take the cron expression from my custom config file:</p>

<pre><code>import org.apache.deltaspike.core.api.config.PropertyFileConfig;

public class myOwnPropertyFileConfig  implements PropertyFileConfig  {
  private static final long serialVersionUID = 1L;

  @Override
  public String getPropertyFileName() {
    return "cfg/myOwnPropFile.properties";
  }

  @Override
  public boolean isOptional() {
    return false;
  }

}
</code></pre>

<p>myOwnPropFile.properties</p>

<pre><code>deltaspike_ordinal=500
property1=value1
property2=value2
QuartzJob=0 25 17 * * ?
</code></pre>

<p>the job:</p>

<pre><code>@Scheduled(cronExpression = "{QuartzJob}")
public class MyQuartzJob implements Job {
  //job code
}
</code></pre>

<p>Everything goes good when I set this property: QuartzJob=0 25 17 * * ?
inside apache-deltaspike.properties, but when I set it in my own property file, I get:</p>

<pre><code>java.lang.IllegalStateException: No config-value found for config-key: QuartzJob 
</code></pre>

<p>Researching, I found that my property file is loaded right after Quartz initialization, and that explains the why. Now, I read in Deltaspike doc that it's possible to get my property file loaded whenever I want, using deltaspike_ordinal inside my property file. So I tried, but it seems to ignore the deltaspike_ordinal=500, and error keeps arising.</p>

<p>So, does someone know how to sort this out? Deltaspike doc also talks about a ConfigSource and so, but it's not so clear and there are no examples.</p>

<p>Thanks in advance!</p>