Package org.apache.camel.spring.util
Class MainRunner
- java.lang.Object
-
- org.apache.camel.spring.util.MainRunner
-
- All Implemented Interfaces:
Runnable,InitializingBean
public class MainRunner extends Object implements InitializingBean, Runnable
A simple helper bean for running main classes from within the spring.xml usually asynchronous in a background thread; which is useful for demos such as running Swing programs in the same JVM.
-
-
Constructor Summary
Constructors Constructor Description MainRunner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()String[]getArgs()longgetDelay()Class<?>getMain()booleanisAsyncRun()voidrun()voidrunMethodWithoutCatchingExceptions()voidsetArgs(String[] args)voidsetAsyncRun(boolean asyncRun)voidsetDelay(long delay)voidsetMain(Class<?> main)StringtoString()
-
-
-
Constructor Detail
-
MainRunner
public MainRunner()
-
-
Method Detail
-
runMethodWithoutCatchingExceptions
public void runMethodWithoutCatchingExceptions() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
-
isAsyncRun
public boolean isAsyncRun()
-
setAsyncRun
public void setAsyncRun(boolean asyncRun)
-
getDelay
public long getDelay()
-
setDelay
public void setDelay(long delay)
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-
-