All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.molgenis.r.RScriptRegistrator Maven / Gradle / Ivy

There is a newer version: 8.4.5
Show newest version
package org.molgenis.r;

import org.molgenis.script.ScriptRunnerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

@Component
public class RScriptRegistrator implements ApplicationListener, Ordered
{
	private final ScriptRunnerFactory scriptRunnerFactory;
	private final RScriptRunner rScriptRunner;

	@Autowired
	public RScriptRegistrator(ScriptRunnerFactory scriptRunnerFactory, RScriptRunner rScriptRunner)
	{
		this.scriptRunnerFactory = scriptRunnerFactory;
		this.rScriptRunner = rScriptRunner;
	}

	@Override
	public int getOrder()
	{
		return Ordered.LOWEST_PRECEDENCE;
	}

	@Override
	public void onApplicationEvent(ContextRefreshedEvent event)
	{
		scriptRunnerFactory.registerScriptExecutor("R", rScriptRunner);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy