org.apache.camel.spring.util
Class MainRunner

java.lang.Object
  extended by org.apache.camel.spring.util.MainRunner
All Implemented Interfaces:
Runnable, org.springframework.beans.factory.InitializingBean

public class MainRunner
extends Object
implements org.springframework.beans.factory.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.

Version:

Constructor Summary
MainRunner()
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MainRunner

public MainRunner()
Method Detail

toString

public String toString()
Overrides:
toString in class Object

run

public void run()
Specified by:
run in interface Runnable

runMethodWithoutCatchingExceptions

public void runMethodWithoutCatchingExceptions()
                                        throws NoSuchMethodException,
                                               IllegalAccessException,
                                               InvocationTargetException
Throws:
NoSuchMethodException
IllegalAccessException
InvocationTargetException

getArgs

public String[] getArgs()

setArgs

public void setArgs(String[] args)

isAsyncRun

public boolean isAsyncRun()

setAsyncRun

public void setAsyncRun(boolean asyncRun)

getMain

public Class<?> getMain()

setMain

public void setMain(Class<?> main)

getDelay

public long getDelay()

setDelay

public void setDelay(long delay)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Apache Camel