|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.support.ServiceSupport org.apache.camel.main.MainSupport
public abstract class MainSupport
Nested Class Summary | |
---|---|
class |
MainSupport.Option
|
class |
MainSupport.ParameterOption
|
Field Summary | |
---|---|
protected boolean |
aggregateDot
|
protected List<CamelContext> |
camelContexts
|
protected ProducerTemplate |
camelTemplate
|
protected AtomicBoolean |
completed
|
protected String |
dotOutputDir
|
protected long |
duration
|
protected CountDownLatch |
latch
|
protected static org.slf4j.Logger |
LOG
|
protected List<MainSupport.Option> |
options
|
protected String |
routeBuilderClasses
|
protected List<RouteBuilder> |
routeBuilders
|
protected String |
routesOutputFile
|
protected TimeUnit |
timeUnit
|
protected boolean |
trace
|
Fields inherited from class org.apache.camel.support.ServiceSupport |
---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
Constructor Summary | |
---|---|
protected |
MainSupport()
|
Method Summary | |
---|---|
void |
addOption(MainSupport.Option option)
|
void |
addRouteBuilder(RouteBuilder routeBuilder)
|
protected void |
afterStart()
Callback to run custom logic after CamelContext has been started. |
protected void |
beforeStop()
Callback to run custom logic before CamelContext is being stopped. |
void |
completed()
Marks this process as being completed. |
protected abstract ModelFileGenerator |
createModelFileGenerator()
|
protected void |
doStart()
Implementations override this method to support customized start/stop. |
protected void |
doStop()
Implementations override this method to support customized start/stop. |
void |
enableHangupSupport()
Enables the hangup support. |
void |
enableTrace()
|
protected abstract ProducerTemplate |
findOrCreateCamelTemplate()
|
protected void |
generateDot(String name,
CamelContext camelContext,
int size)
|
protected abstract Map<String,CamelContext> |
getCamelContextMap()
|
List<CamelContext> |
getCamelContexts()
|
ProducerTemplate |
getCamelTemplate()
|
String |
getDotOutputDir()
|
long |
getDuration()
|
String |
getRouteBuilderClasses()
|
List<RouteBuilder> |
getRouteBuilders()
|
List<RouteDefinition> |
getRouteDefinitions()
|
String |
getRoutesOutputFile()
|
TimeUnit |
getTimeUnit()
|
boolean |
isAggregateDot()
|
boolean |
isTrace()
|
protected void |
loadRouteBuilders(CamelContext camelContext)
|
protected void |
outputRoutesToFile()
|
void |
parseArguments(String[] arguments)
Parses the command line arguments. |
protected void |
postProcessCamelContext(CamelContext camelContext)
|
protected void |
postProcessContext()
|
void |
run()
Runs this process with the given arguments, and will wait until completed, or the JVM terminates. |
void |
run(String[] args)
Parses the command line arguments then runs the program. |
void |
setAggregateDot(boolean aggregateDot)
|
void |
setDotOutputDir(String dotOutputDir)
Sets the output directory of the generated DOT Files to show the visual representation of the routes. |
void |
setDuration(long duration)
Sets the duration to run the application for in milliseconds until it should be terminated. |
void |
setRouteBuilderClasses(String builders)
|
void |
setRouteBuilders(List<RouteBuilder> routeBuilders)
|
void |
setRoutesOutputFile(String routesOutputFile)
|
void |
setTimeUnit(TimeUnit timeUnit)
Sets the time unit duration. |
void |
showOptions()
Displays the command line options. |
void |
showOptionsHeader()
Displays the header message for the command line options. |
protected void |
waitUntilCompleted()
|
Methods inherited from class org.apache.camel.support.ServiceSupport |
---|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger LOG
protected String dotOutputDir
protected final List<MainSupport.Option> options
protected final CountDownLatch latch
protected final AtomicBoolean completed
protected long duration
protected TimeUnit timeUnit
protected String routesOutputFile
protected boolean aggregateDot
protected boolean trace
protected List<RouteBuilder> routeBuilders
protected String routeBuilderClasses
protected final List<CamelContext> camelContexts
protected ProducerTemplate camelTemplate
Constructor Detail |
---|
protected MainSupport()
Method Detail |
---|
public void run() throws Exception
Exception
public void enableHangupSupport()
protected void afterStart() throws Exception
Exception
protected void beforeStop() throws Exception
Exception
public void completed()
public void showOptions()
public void parseArguments(String[] arguments)
public void addOption(MainSupport.Option option)
public long getDuration()
public void setDuration(long duration)
public TimeUnit getTimeUnit()
public void setTimeUnit(TimeUnit timeUnit)
public String getDotOutputDir()
public void setRouteBuilderClasses(String builders)
public String getRouteBuilderClasses()
public void setDotOutputDir(String dotOutputDir)
public void setAggregateDot(boolean aggregateDot)
public boolean isAggregateDot()
public boolean isTrace()
public void enableTrace()
public void setRoutesOutputFile(String routesOutputFile)
public String getRoutesOutputFile()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.
doStop
in class ServiceSupport
Exception
ServiceSupport.doStart()
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.
doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void waitUntilCompleted()
public void run(String[] args) throws Exception
Exception
public void showOptionsHeader()
public List<CamelContext> getCamelContexts()
public List<RouteBuilder> getRouteBuilders()
public void setRouteBuilders(List<RouteBuilder> routeBuilders)
public List<RouteDefinition> getRouteDefinitions()
public ProducerTemplate getCamelTemplate() throws Exception
Exception
protected abstract ProducerTemplate findOrCreateCamelTemplate()
protected abstract Map<String,CamelContext> getCamelContextMap()
protected void postProcessContext() throws Exception
Exception
protected void outputRoutesToFile() throws IOException, JAXBException
IOException
JAXBException
protected abstract ModelFileGenerator createModelFileGenerator() throws JAXBException
JAXBException
protected void generateDot(String name, CamelContext camelContext, int size) throws IOException
IOException
protected void loadRouteBuilders(CamelContext camelContext) throws Exception
Exception
protected void postProcessCamelContext(CamelContext camelContext) throws Exception
Exception
public void addRouteBuilder(RouteBuilder routeBuilder)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |