@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JaxbDataFormat.class) public JaxbDataFormat configureJaxbDataFormat(CamelContext camelContext, JaxbDataFormatConfiguration configuration) throws Exception { JaxbDataFormat dataformat = new JaxbDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Override protected void doStart() throws Exception { // inject CamelContext before starting if (jsonMarshal instanceof CamelContextAware) { ((CamelContextAware) jsonMarshal).setCamelContext(camelContext); } if (jsonUnmarshal instanceof CamelContextAware) { ((CamelContextAware) jsonUnmarshal).setCamelContext(camelContext); } if (xmlMarshal instanceof CamelContextAware) { ((CamelContextAware) xmlMarshal).setCamelContext(camelContext); } if (xmlUnmarshal instanceof CamelContextAware) { ((CamelContextAware) xmlUnmarshal).setCamelContext(camelContext); } ServiceHelper.startServices(jsonMarshal, jsonUnmarshal, xmlMarshal, xmlUnmarshal); }
@Override public void addFallbackTypeConverter(TypeConverter typeConverter, boolean canPromote) { log.trace("Adding fallback type converter: {} which can promote: {}", typeConverter, canPromote); // add in top of fallback as the toString() fallback will nearly always be able to convert // the last one which is add to the FallbackTypeConverter will be called at the first place fallbackConverters.add(0, new FallbackTypeConverter(typeConverter, canPromote)); if (typeConverter instanceof TypeConverterAware) { TypeConverterAware typeConverterAware = (TypeConverterAware) typeConverter; typeConverterAware.setTypeConverter(this); } if (typeConverter instanceof CamelContextAware) { CamelContextAware camelContextAware = (CamelContextAware) typeConverter; if (camelContext != null) { camelContextAware.setCamelContext(camelContext); } } }
/** * Apply this post processor to the given new bean instance <i>before</i> any bean * initialization callbacks (like <code>afterPropertiesSet</code> * or a custom init-method). The bean will already be populated with property values. * The returned bean instance may be a wrapper around the original. * * @param bean the new bean instance * @param beanName the name of the bean * @return the bean instance to use, either the original or a wrapped one; if * <code>null</code>, no subsequent BeanPostProcessors will be invoked * @throws Exception is thrown if error post processing bean */ public Object postProcessBeforeInitialization(Object bean, String beanName) throws Exception { LOG.trace("Camel bean processing before initialization for bean: {}", beanName); // some beans cannot be post processed at this given time, so we gotta check beforehand if (!canPostProcessBean(bean, beanName)) { return bean; } injectFields(bean, beanName); injectMethods(bean, beanName); if (bean instanceof CamelContextAware && canSetCamelContext(bean, beanName)) { CamelContextAware contextAware = (CamelContextAware)bean; CamelContext context = getOrLookupCamelContext(); if (context == null) { LOG.warn("No CamelContext defined yet so cannot inject into bean: " + beanName); } else { contextAware.setCamelContext(context); } } return bean; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(StringDataFormat.class) public StringDataFormat configureStringDataFormat( CamelContext camelContext, StringDataFormatConfiguration configuration) throws Exception { StringDataFormat dataformat = new StringDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ZipDataFormat.class) public ZipDataFormat configureZipDataFormat(CamelContext camelContext, ZipDataFormatConfiguration configuration) throws Exception { ZipDataFormat dataformat = new ZipDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SerializationDataFormat.class) public SerializationDataFormat configureSerializationDataFormat( CamelContext camelContext, SerializationDataFormatConfiguration configuration) throws Exception { SerializationDataFormat dataformat = new SerializationDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GzipDataFormat.class) public GzipDataFormat configureGzipDataFormat(CamelContext camelContext, GzipDataFormatConfiguration configuration) throws Exception { GzipDataFormat dataformat = new GzipDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Override protected void doStart() throws Exception { if (binding == null) { binding = CamelContextHelper.mandatoryLookup(getCamelContext(), bindingName, Binding.class); } if (delegate == null) { delegate = getMandatoryEndpoint(getCamelContext(), delegateUri); } // inject CamelContext if (binding instanceof CamelContextAware) { ((CamelContextAware) binding).setCamelContext(getCamelContext()); } ServiceHelper.startServices(delegate, binding); super.doStart(); }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(XMLSecurityDataFormat.class) public XMLSecurityDataFormat configureXMLSecurityDataFormat( CamelContext camelContext, XMLSecurityDataFormatConfiguration configuration) throws Exception { XMLSecurityDataFormat dataformat = new XMLSecurityDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(UniVocityTsvDataFormat.class) public UniVocityTsvDataFormat configureUniVocityTsvDataFormat( CamelContext camelContext, UniVocityTsvDataFormatConfiguration configuration) throws Exception { UniVocityTsvDataFormat dataformat = new UniVocityTsvDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(UniVocityFixedWidthDataFormat.class) public UniVocityFixedWidthDataFormat configureUniVocityFixedWidthDataFormat( CamelContext camelContext, UniVocityFixedWidthDataFormatConfiguration configuration) throws Exception { UniVocityFixedWidthDataFormat dataformat = new UniVocityFixedWidthDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(UniVocityCsvDataFormat.class) public UniVocityCsvDataFormat configureUniVocityCsvDataFormat( CamelContext camelContext, UniVocityCsvDataFormatConfiguration configuration) throws Exception { UniVocityCsvDataFormat dataformat = new UniVocityCsvDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Test public void testCxfEndpointHasCamelContext() throws Exception { String s = "<GetPerson xmlns=\"http://camel.apache.org/wsdl-first/types\"><personId>123</personId></GetPerson>"; Document xml = context.getTypeConverter().convertTo(Document.class, s); log.info("Endpoints: {}", context.getEndpoints()); Object output = template.requestBody("personService", xml); assertNotNull(output); // using CxfPayload in payload mode CxfPayload<?> payload = (CxfPayload<?>) output; // convert the payload body to string String reply = context.getTypeConverter().convertTo(String.class, payload.getBody().get(0)); assertNotNull(reply); assertTrue(reply.contains("<personId>123</personId")); assertTrue(reply.contains("<ssn>456</ssn")); assertTrue(reply.contains("<name>Donald Duck</name")); assertTrue(context.getEndpoint("personService") instanceof CamelContextAware); assertNotNull("CamelContext should be set on CxfEndpoint", context.getEndpoint("personService").getCamelContext()); }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(BoonDataFormat.class) public BoonDataFormat configureBoonDataFormat(CamelContext camelContext, BoonDataFormatConfiguration configuration) throws Exception { BoonDataFormat dataformat = new BoonDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SyslogDataFormat.class) public SyslogDataFormat configureSyslogDataFormat( CamelContext camelContext, SyslogDataFormatConfiguration configuration) throws Exception { SyslogDataFormat dataformat = new SyslogDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JacksonDataFormat.class) public JacksonDataFormat configureJacksonDataFormat( CamelContext camelContext, JacksonDataFormatConfiguration configuration) throws Exception { JacksonDataFormat dataformat = new JacksonDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(HessianDataFormat.class) public HessianDataFormat configureHessianDataFormat( CamelContext camelContext, HessianDataFormatConfiguration configuration) throws Exception { HessianDataFormat dataformat = new HessianDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SoapJaxbDataFormat.class) public SoapJaxbDataFormat configureSoapJaxbDataFormat( CamelContext camelContext, SoapJaxbDataFormatConfiguration configuration) throws Exception { SoapJaxbDataFormat dataformat = new SoapJaxbDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(AvroDataFormat.class) public AvroDataFormat configureAvroDataFormat(CamelContext camelContext, AvroDataFormatConfiguration configuration) throws Exception { AvroDataFormat dataformat = new AvroDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JibxDataFormat.class) public JibxDataFormat configureJibxDataFormat(CamelContext camelContext, JibxDataFormatConfiguration configuration) throws Exception { JibxDataFormat dataformat = new JibxDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CsvDataFormat.class) public CsvDataFormat configureCsvDataFormat(CamelContext camelContext, CsvDataFormatConfiguration configuration) throws Exception { CsvDataFormat dataformat = new CsvDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(TarFileDataFormat.class) public TarFileDataFormat configureTarFileDataFormat( CamelContext camelContext, TarFileDataFormatConfiguration configuration) throws Exception { TarFileDataFormat dataformat = new TarFileDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(HL7DataFormat.class) public HL7DataFormat configureHL7DataFormat(CamelContext camelContext, HL7DataFormatConfiguration configuration) throws Exception { HL7DataFormat dataformat = new HL7DataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JacksonXMLDataFormat.class) public JacksonXMLDataFormat configureJacksonXMLDataFormat( CamelContext camelContext, JacksonXMLDataFormatConfiguration configuration) throws Exception { JacksonXMLDataFormat dataformat = new JacksonXMLDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CastorDataFormat.class) public CastorDataFormat configureCastorDataFormat( CamelContext camelContext, CastorDataFormatConfiguration configuration) throws Exception { CastorDataFormat dataformat = new CastorDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LZFDataFormat.class) public LZFDataFormat configureLZFDataFormat(CamelContext camelContext, LZFDataFormatConfiguration configuration) throws Exception { LZFDataFormat dataformat = new LZFDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(XmlRpcDataFormat.class) public XmlRpcDataFormat configureXmlRpcDataFormat( CamelContext camelContext, XmlRpcDataFormatConfiguration configuration) throws Exception { XmlRpcDataFormat dataformat = new XmlRpcDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RssDataFormat.class) public RssDataFormat configureRssDataFormat(CamelContext camelContext, RssDataFormatConfiguration configuration) throws Exception { RssDataFormat dataformat = new RssDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(BeanIODataFormat.class) public BeanIODataFormat configureBeanIODataFormat( CamelContext camelContext, BeanIODataFormatConfiguration configuration) throws Exception { BeanIODataFormat dataformat = new BeanIODataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SnakeYAMLDataFormat.class) public SnakeYAMLDataFormat configureSnakeYAMLDataFormat( CamelContext camelContext, SnakeYAMLDataFormatConfiguration configuration) throws Exception { SnakeYAMLDataFormat dataformat = new SnakeYAMLDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(BindyFixedLengthDataFormat.class) public BindyFixedLengthDataFormat configureBindyFixedLengthDataFormat( CamelContext camelContext, BindyFixedLengthDataFormatConfiguration configuration) throws Exception { BindyFixedLengthDataFormat dataformat = new BindyFixedLengthDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(BindyKeyValuePairDataFormat.class) public BindyKeyValuePairDataFormat configureBindyKeyValuePairDataFormat( CamelContext camelContext, BindyKeyValuePairDataFormatConfiguration configuration) throws Exception { BindyKeyValuePairDataFormat dataformat = new BindyKeyValuePairDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JsonDataFormat.class) public JsonDataFormat configureJsonDataFormat(CamelContext camelContext, JsonDataFormatConfiguration configuration) throws Exception { JsonDataFormat dataformat = new JsonDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(XStreamDataFormat.class) public XStreamDataFormat configureXStreamDataFormat( CamelContext camelContext, XStreamDataFormatConfiguration configuration) throws Exception { XStreamDataFormat dataformat = new XStreamDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(XmlJsonDataFormat.class) public XmlJsonDataFormat configureXmlJsonDataFormat( CamelContext camelContext, XmlJsonDataFormatConfiguration configuration) throws Exception { XmlJsonDataFormat dataformat = new XmlJsonDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ICalDataFormat.class) public ICalDataFormat configureICalDataFormat(CamelContext camelContext, ICalDataFormatConfiguration configuration) throws Exception { ICalDataFormat dataformat = new ICalDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MimeMultipartDataFormat.class) public MimeMultipartDataFormat configureMimeMultipartDataFormat( CamelContext camelContext, MimeMultipartDataFormatConfiguration configuration) throws Exception { MimeMultipartDataFormat dataformat = new MimeMultipartDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(FlatpackDataFormat.class) public FlatpackDataFormat configureFlatpackDataFormat( CamelContext camelContext, FlatpackDataFormatConfiguration configuration) throws Exception { FlatpackDataFormat dataformat = new FlatpackDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }
@Bean @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CryptoDataFormat.class) public CryptoDataFormat configureCryptoDataFormat( CamelContext camelContext, CryptoDataFormatConfiguration configuration) throws Exception { CryptoDataFormat dataformat = new CryptoDataFormat(); if (dataformat instanceof CamelContextAware) { ((CamelContextAware) dataformat).setCamelContext(camelContext); } Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters); return dataformat; }