org.apache.camel.guice
Class GuiceCamelContext

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultCamelContext
          extended by org.apache.camel.guice.GuiceCamelContext
All Implemented Interfaces:
CamelContext, RuntimeConfiguration, Service, ShutdownableService, SuspendableService

public class GuiceCamelContext
extends DefaultCamelContext

The default CamelContext implementation for working with Guice.

It is recommended you use this implementation with the Guicey JNDI Provider

Version:
$Revision: 21807 $

Constructor Summary
GuiceCamelContext(com.google.inject.Injector injector)
           
 
Method Summary
protected  Context createContext()
           
protected  Injector createInjector()
          Lazily create a default implementation
protected  Registry createRegistry()
          Lazily create a default implementation
 void setAutoCreateComponents(boolean autoCreateComponents)
           
 void setComponentResolver(ComponentResolver componentResolver)
           
 void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
          Sets the default error handler builder which is inherited by the routes
 void setInjector(Injector injector)
           
 void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
           
 void setJndiContext(Context jndiContext)
          Sets the registry to the given JNDI context
 void setLanguageResolver(LanguageResolver languageResolver)
           
 void setLifecycleStrategies(List<LifecycleStrategy> lifecycleStrategies)
           
 void setRegistry(Registry registry)
           
 void setRouteBuilders(Set<RoutesBuilder> routeBuilders)
           
 void setTypeConverter(TypeConverter typeConverter)
           
 void start()
          Starts the service
 void stop()
          Stops the service
 
Methods inherited from class org.apache.camel.impl.DefaultCamelContext
addComponent, addEndpoint, addEndpointToRegistry, addInterceptStrategy, addLifecycleStrategy, addRegisterEndpointCallback, addRouteDefinition, addRouteDefinitions, addRoutes, addService, addStartupListener, convertBeanToEndpoint, createComponentResolver, createConsumerTemplate, createConsumerTemplate, createEndpoint, createManagementStrategy, createProducerTemplate, createProducerTemplate, createTypeConverter, disableJMX, doResume, doStart, doStartOrResumeRoutes, doStop, doSuspend, forceLazyInitialization, forceStopLazyInitialization, getApplicationContextClassLoader, getClassResolver, getComponent, getComponent, getComponentNames, getComponentResolver, getDataFormatResolver, getDataFormats, getDebugger, getDefaultFactoryFinder, getDefaultTracer, getDelayer, getEndpoint, getEndpoint, getEndpointKey, getEndpointMap, getEndpoints, getErrorHandlerBuilder, getExecutorServiceStrategy, getFactoryFinder, getInflightRepository, getInjector, getInterceptStrategies, getLanguageNames, getLanguageResolver, getLifecycleStrategies, getManagementName, getManagementStrategy, getName, getNameStrategy, getNodeIdFactory, getPackageScanClassResolver, getProcessorFactory, getProducerServicePool, getProperties, getRegistry, getRoute, getRouteDefinition, getRouteDefinitions, getRoutes, getRouteServices, getRouteStartupOrder, getRouteStatus, getShutdownRoute, getShutdownRunningTask, getShutdownStrategy, getTypeConverter, getTypeConverterRegistry, getUptime, getUuidGenerator, hasComponent, hasEndpoint, hasService, isAutoCreateComponents, isAutoStartup, isHandleFault, isLazyLoadTypeConverters, isStreamCaching, isTracing, removeComponent, removeEndpoints, removeRoute, removeRouteDefinition, removeRouteDefinition, removeRouteDefinitions, resolveDataFormat, resolveDataFormatDefinition, resolveLanguage, resolvePropertyPlaceholders, resumeRoute, resumeRouteService, routeSupportsSuspension, safelyStartRouteServices, safelyStartRouteServices, setApplicationContextClassLoader, setAutoStartup, setClassResolver, setContextCounter, setDataFormatResolver, setDataFormats, setDebugger, setDefaultTracer, setDelayer, setExecutorServiceStrategy, setFactoryFinderResolver, setHandleFault, setInflightRepository, setLazyLoadTypeConverters, setManagementName, setManagementStrategy, setName, setNameStrategy, setNodeIdFactory, setPackageScanClassResolver, setProcessorFactory, setProducerServicePool, setProperties, setRoutes, setShutdownRoute, setShutdownRunningTask, setShutdownStrategy, setStreamCaching, setTracing, setTypeConverterRegistry, setUuidGenerator, shouldStartRoutes, shutdownRoute, shutdownRoute, shutdownRouteService, startRoute, startRoute, startRouteDefinitions, startRouteService, stopRoute, stopRoute, stopRoute, stopRouteService, suspendRoute, suspendRoute, suspendRouteService, toString
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.CamelContext
getStatus, getVersion
 
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
 

Constructor Detail

GuiceCamelContext

@Inject
public GuiceCamelContext(com.google.inject.Injector injector)
Method Detail

start

@PostConstruct
public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Overrides:
start in class DefaultCamelContext
Throws:
Exception - is thrown if starting failed

stop

@PreDestroy
public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Overrides:
stop in class ServiceSupport
Throws:
Exception - is thrown if stopping failed

setRouteBuilders

@Inject
public void setRouteBuilders(Set<RoutesBuilder> routeBuilders)
                      throws Exception
Throws:
Exception

setRegistry

@Inject(optional=true)
public void setRegistry(Registry registry)
Overrides:
setRegistry in class DefaultCamelContext

setJndiContext

@Inject(optional=true)
public void setJndiContext(Context jndiContext)
Description copied from class: DefaultCamelContext
Sets the registry to the given JNDI context

Overrides:
setJndiContext in class DefaultCamelContext
Parameters:
jndiContext - is the JNDI context to use as the registry
See Also:
DefaultCamelContext.setRegistry(org.apache.camel.spi.Registry)

setInjector

@Inject(optional=true)
public void setInjector(Injector injector)
Overrides:
setInjector in class DefaultCamelContext

setComponentResolver

@Inject(optional=true)
public void setComponentResolver(ComponentResolver componentResolver)
Overrides:
setComponentResolver in class DefaultCamelContext

setAutoCreateComponents

@Inject(optional=true)
public void setAutoCreateComponents(boolean autoCreateComponents)
Overrides:
setAutoCreateComponents in class DefaultCamelContext

setErrorHandlerBuilder

@Inject(optional=true)
public void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
Description copied from interface: CamelContext
Sets the default error handler builder which is inherited by the routes

Specified by:
setErrorHandlerBuilder in interface CamelContext
Overrides:
setErrorHandlerBuilder in class DefaultCamelContext
Parameters:
errorHandlerBuilder - the builder

setInterceptStrategies

@Inject(optional=true)
public void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
Overrides:
setInterceptStrategies in class DefaultCamelContext

setLanguageResolver

@Inject(optional=true)
public void setLanguageResolver(LanguageResolver languageResolver)
Overrides:
setLanguageResolver in class DefaultCamelContext

setLifecycleStrategies

@Inject(optional=true)
public void setLifecycleStrategies(List<LifecycleStrategy> lifecycleStrategies)
Overrides:
setLifecycleStrategies in class DefaultCamelContext

setTypeConverter

@Inject(optional=true)
public void setTypeConverter(TypeConverter typeConverter)
Overrides:
setTypeConverter in class DefaultCamelContext

createInjector

protected Injector createInjector()
Description copied from class: DefaultCamelContext
Lazily create a default implementation

Overrides:
createInjector in class DefaultCamelContext

createRegistry

protected Registry createRegistry()
Description copied from class: DefaultCamelContext
Lazily create a default implementation

Overrides:
createRegistry in class DefaultCamelContext

createContext

protected Context createContext()


Apache CAMEL