public class Main extends MainSupport
MainSupport.Option, MainSupport.ParameterOption
Modifier and Type | Field and Description |
---|---|
protected static Main |
instance |
protected SimpleRegistry |
registry |
aggregateDot, camelContexts, camelTemplate, completed, dotOutputDir, duration, latch, LOG, options, routeBuilderClasses, routeBuilders, routesOutputFile, timeUnit, trace
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
Main() |
Modifier and Type | Method and Description |
---|---|
void |
bind(String name,
Object bean)
Binds the given
name to the bean object, so
that it can be looked up inside the CamelContext this command line tool
runs with. |
protected CamelContext |
createContext() |
protected 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.
|
protected ProducerTemplate |
findOrCreateCamelTemplate() |
protected Map<String,CamelContext> |
getCamelContextMap() |
static Main |
getInstance()
Returns the currently executing main
|
Object |
lookup(String name)
Using the given
name does lookup for the bean being already
bound using the bind(String, Object) method. |
<T> T |
lookup(String name,
Class<T> type)
Using the given
name and type does lookup for
the bean being already bound using the bind(String, Object)
method. |
<T> Map<String,T> |
lookupByType(Class<T> type)
Using the given
type does lookup for the bean being already
bound using the bind(String, Object) method. |
static void |
main(String... args) |
addOption, addRouteBuilder, afterStart, beforeStop, completed, enableHangupSupport, enableTrace, generateDot, getCamelContexts, getCamelTemplate, getDotOutputDir, getDuration, getRouteBuilderClasses, getRouteBuilders, getRouteDefinitions, getRoutesOutputFile, getTimeUnit, isAggregateDot, isTrace, loadRouteBuilders, outputRoutesToFile, parseArguments, postProcessCamelContext, postProcessContext, run, run, setAggregateDot, setDotOutputDir, setDuration, setRouteBuilderClasses, setRouteBuilders, setRoutesOutputFile, setTimeUnit, showOptions, showOptionsHeader, waitUntilCompleted
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
protected static Main instance
protected final SimpleRegistry registry
public static Main getInstance()
public void bind(String name, Object bean)
name
to the bean
object, so
that it can be looked up inside the CamelContext this command line tool
runs with.name
- the used name through which we do bindbean
- the object to bindpublic Object lookup(String name)
name
does lookup for the bean being already
bound using the bind(String, Object)
method.Registry.lookupByName(String)
public <T> T lookup(String name, Class<T> type)
name
and type
does lookup for
the bean being already bound using the bind(String, Object)
method.public <T> Map<String,T> lookupByType(Class<T> type)
type
does lookup for the bean being already
bound using the bind(String, Object)
method.Registry.findByTypeWithName(Class)
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class MainSupport
Exception
ServiceSupport.doStop()
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 MainSupport
Exception
ServiceSupport.doStart()
protected ProducerTemplate findOrCreateCamelTemplate()
findOrCreateCamelTemplate
in class MainSupport
protected Map<String,CamelContext> getCamelContextMap()
getCamelContextMap
in class MainSupport
protected CamelContext createContext()
protected ModelFileGenerator createModelFileGenerator() throws JAXBException
createModelFileGenerator
in class MainSupport
JAXBException
Apache Camel