org.apache.camel.example.spring.javaconfig
Class MyRouteConfig

java.lang.Object
  extended by org.apache.camel.spring.javaconfig.CamelConfiguration
      extended by org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration
          extended by org.apache.camel.example.spring.javaconfig.MyRouteConfig
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.osgi.context.BundleContextAware

@Configuration
public class MyRouteConfig
extends org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration
implements org.springframework.beans.factory.InitializingBean, org.springframework.osgi.context.BundleContextAware

A simple example router from a file system to an ActiveMQ queue and then to a file system

Version:

Nested Class Summary
static class MyRouteConfig.SomeBean
           
 
Constructor Summary
MyRouteConfig()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  org.apache.camel.CamelContext createCamelContext()
          Returns the CamelContext which support OSGi
 org.osgi.framework.BundleContext getBundleContext()
           
static void main(String[] args)
          Allow this route to be run as an application
 org.apache.camel.builder.RouteBuilder route()
           
 void setBundleContext(org.osgi.framework.BundleContext bundleContext)
           
protected  void setupCamelContext(org.apache.camel.CamelContext camelContext)
           
 
Methods inherited from class org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration
routes
 
Methods inherited from class org.apache.camel.spring.javaconfig.CamelConfiguration
camelBeanPostProcessor, camelContext, getApplicationContext, getBean, getBean, getBean, getBeanFactory, getConfigured, setApplicationContext, setBeanFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyRouteConfig

public MyRouteConfig()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Allow this route to be run as an application

Throws:
Exception

getBundleContext

public org.osgi.framework.BundleContext getBundleContext()

setBundleContext

public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
Specified by:
setBundleContext in interface org.springframework.osgi.context.BundleContextAware

createCamelContext

protected org.apache.camel.CamelContext createCamelContext()
                                                    throws Exception
Returns the CamelContext which support OSGi

Overrides:
createCamelContext in class org.apache.camel.spring.javaconfig.CamelConfiguration
Throws:
Exception

setupCamelContext

protected void setupCamelContext(org.apache.camel.CamelContext camelContext)
                          throws Exception
Overrides:
setupCamelContext in class org.apache.camel.spring.javaconfig.CamelConfiguration
Throws:
Exception

route

@Bean
public org.apache.camel.builder.RouteBuilder route()
Specified by:
route in class org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration

afterPropertiesSet

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


Apache CAMEL