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 void
afterPropertiesSet()
String[]
getArgs()
long
getDelay()
Class<?>
getMain()
boolean
isAsyncRun()
void
run()
void
runMethodWithoutCatchingExceptions()
void
setArgs(String[] args)
void
setAsyncRun(boolean asyncRun)
void
setDelay(long delay)
void
setMain(Class<?> main)
String
toString()
-
-
-
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:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
-