com.jwebmp.guicedinjection.threading.PostStartupRunnable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of guiced-injection Show documentation
Show all versions of guiced-injection Show documentation
Guice Injection allows you to access multiple Guice Binders and Modules across separate archives.
Allowing you to configure your applications with injection from multiple dependancies. Servlets, EJB's, and
Stand-Alone is supported. Requires JDK 8 or 10.
package com.jwebmp.guicedinjection.threading;
import com.jwebmp.guicedinjection.interfaces.IGuicePostStartup;
import java.io.Serializable;
import java.util.concurrent.Callable;
/**
* A thread type future or current to startup asynchronously during post startup execution.
* Executed internally.
*/
public class PostStartupRunnable
implements Runnable, Callable, Serializable
{
private static final long serialVersionUID = 1L;
private transient IGuicePostStartup startup;
public PostStartupRunnable(IGuicePostStartup startup)
{
this.startup = startup;
}
@Override
public PostStartupRunnable call()
{
run();
return this;
}
@Override
public void run()
{
startup.postLoad();
startup = null;
}
}