org.apache.camel.spring
Class Main

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.MainSupport
          extended by org.apache.camel.spring.Main
All Implemented Interfaces:
Service, ShutdownableService
Direct Known Subclasses:
Main, Main

public class Main
extends MainSupport

A command line tool for booting up a CamelContext using an optional Spring ApplicationContext

Version:
$Revision: 21803 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.camel.impl.MainSupport
MainSupport.Option, MainSupport.ParameterOption
 
Field Summary
protected static Main instance
           
 
Fields inherited from class org.apache.camel.impl.MainSupport
aggregateDot, camelContexts, camelTemplate, completed, dotOutputDir, duration, latch, LOG, options, routeBuilders, routesOutputFile, timeUnit, trace
 
Constructor Summary
Main()
           
 
Method Summary
protected  AbstractApplicationContext createDefaultApplicationContext()
           
protected  ModelFileGenerator createModelFileGenerator()
           
protected  void doStart()
           
protected  void doStop()
           
 void enableHangupSupport()
          Enables the hangup support.
protected  ProducerTemplate findOrCreateCamelTemplate()
           
 AbstractApplicationContext getApplicationContext()
           
 String getApplicationContextUri()
           
protected  Map<String,CamelContext> getCamelContextMap()
           
 String getFileApplicationContextUri()
           
static Main getInstance()
          Returns the currently executing main
 AbstractApplicationContext getParentApplicationContext()
           
 String getParentApplicationContextUri()
           
static void main(String... args)
           
 void setApplicationContext(AbstractApplicationContext applicationContext)
           
 void setApplicationContextUri(String applicationContextUri)
           
 void setFileApplicationContextUri(String fileApplicationContextUri)
           
 void setParentApplicationContext(AbstractApplicationContext parentApplicationContext)
           
 void setParentApplicationContextUri(String parentApplicationContextUri)
           
 
Methods inherited from class org.apache.camel.impl.MainSupport
addOption, addRouteBuilder, afterStart, beforeStop, completed, enableTrace, generateDot, getCamelContexts, getCamelTemplate, getDotOutputDir, getDuration, getRouteBuilders, getRouteDefinitions, getRoutesOutputFile, getTimeUnit, isAggregateDot, isTrace, outputRoutesToFile, parseArguments, postProcessCamelContext, postProcessContext, run, run, setAggregateDot, setDotOutputDir, setDuration, setRouteBuilders, setRoutesOutputFile, setTimeUnit, showOptions, showOptionsHeader, waitUntilCompleted
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static Main instance
Constructor Detail

Main

public Main()
Method Detail

main

public static void main(String... args)
                 throws Exception
Throws:
Exception

getInstance

public static Main getInstance()
Returns the currently executing main

Returns:
the current running instance

enableHangupSupport

public void enableHangupSupport()
Enables the hangup support. Gracefully stops by calling stop() on a Hangup signal.


getApplicationContext

public AbstractApplicationContext getApplicationContext()

setApplicationContext

public void setApplicationContext(AbstractApplicationContext applicationContext)

getApplicationContextUri

public String getApplicationContextUri()

setApplicationContextUri

public void setApplicationContextUri(String applicationContextUri)

getFileApplicationContextUri

public String getFileApplicationContextUri()

setFileApplicationContextUri

public void setFileApplicationContextUri(String fileApplicationContextUri)

getParentApplicationContext

public AbstractApplicationContext getParentApplicationContext()

setParentApplicationContext

public void setParentApplicationContext(AbstractApplicationContext parentApplicationContext)

getParentApplicationContextUri

public String getParentApplicationContextUri()

setParentApplicationContextUri

public void setParentApplicationContextUri(String parentApplicationContextUri)

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class MainSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class MainSupport
Throws:
Exception

findOrCreateCamelTemplate

protected ProducerTemplate findOrCreateCamelTemplate()
Specified by:
findOrCreateCamelTemplate in class MainSupport

createDefaultApplicationContext

protected AbstractApplicationContext createDefaultApplicationContext()

getCamelContextMap

protected Map<String,CamelContext> getCamelContextMap()
Specified by:
getCamelContextMap in class MainSupport

createModelFileGenerator

protected ModelFileGenerator createModelFileGenerator()
                                               throws JAXBException
Specified by:
createModelFileGenerator in class MainSupport
Throws:
JAXBException


Apache CAMEL