Index sync job

Fix for #75. Got rid of the controller and made it into a Quartz job with a configurable frequency. Also added an option to make the index sync on startup.
:-(
I think its because vraptor-quartzjob is building the task instance through
reflection in this class:
https://github.com/caelum/vraptor-quartzjob/blob/master/src/main/java/br/com/caelum/vraptor/quartzjob/QuartzScheduler.java#L108
.

But I think it should be possible to get the controller instance using
CDI's api. I'll take at the plugin later.

For now your solution is fine, then.



--
Chico Sokol

On Mon, Sep 29, 2014 at 2:52 PM, monitorjbl <notifications@github.com>
wrote:

> In src/main/java/org/mamute/search/IndexSyncJob.java:
>
> > +	public void onStartup(@Observes InterceptorsReady init) {
> > +		if (Boolean.parseBoolean(environment.get("solr.syncOnStartup"))) {
> > +			execute();
> > +		}
> > +	}
> > +
> > +	/**
> > +	 * Grabs the frequency of the job (bit of a hack to get things in the
> > +	 * correct scope)
> > +	 */
> > +	@ApplicationScoped
> > +	static class FrequencyInit {
> > +		@Inject private Environment environment;
> > +
> > +		public void onStartup(@Observes VRaptorInitialized init) {
> > +			frequency = environment.get("solr.syncJob", DEFAULT_SYNC);
>
> Sadly, no. This appears to be called by the vRaptor-quartz library
> entirely outside of the CDI. All @Injected fields are null when this is
> called.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/caelum/mamute/pull/79/files#r18186341>.
>