builder.addPropertyValue("id", contextId); builder.addPropertyValue("implicitId", implicitId); builder.addPropertyValue("restConfiguration", factoryBean.getRestConfiguration()); builder.addPropertyValue("rests", factoryBean.getRests()); builder.addPropertyValue("routes", factoryBean.getRoutes()); builder.addPropertyValue("intercepts", factoryBean.getIntercepts()); builder.addPropertyValue("interceptFroms", factoryBean.getInterceptFroms()); builder.addPropertyValue("interceptSendToEndpoints", factoryBean.getInterceptSendToEndpoints()); builder.addPropertyValue("dataFormats", factoryBean.getDataFormats()); builder.addPropertyValue("transformers", factoryBean.getTransformers()); builder.addPropertyValue("validators", factoryBean.getValidators()); builder.addPropertyValue("onCompletions", factoryBean.getOnCompletions()); builder.addPropertyValue("onExceptions", factoryBean.getOnExceptions()); builder.addPropertyValue("builderRefs", factoryBean.getBuilderRefs()); builder.addPropertyValue("routeRefs", factoryBean.getRouteRefs()); builder.addPropertyValue("restRefs", factoryBean.getRestRefs()); builder.addPropertyValue("properties", factoryBean.getProperties()); builder.addPropertyValue("globalOptions", factoryBean.getGlobalOptions()); builder.addPropertyValue("packageScan", factoryBean.getPackageScan()); builder.addPropertyValue("contextScan", factoryBean.getContextScan()); if (factoryBean.getPackages().length > 0) { builder.addPropertyValue("packages", factoryBean.getPackages()); builder.addPropertyValue("camelPropertyPlaceholder", factoryBean.getCamelPropertyPlaceholder()); builder.addPropertyValue("camelJMXAgent", factoryBean.getCamelJMXAgent()); builder.addPropertyValue("camelStreamCachingStrategy", factoryBean.getCamelStreamCachingStrategy()); builder.addPropertyValue("threadPoolProfiles", factoryBean.getThreadPoolProfiles()); builder.addPropertyValue("beansFactory", factoryBean.getBeansFactory()); builder.addPropertyValue("beans", factoryBean.getBeans());
public SpringCamelContext getContext(boolean create) { if (context == null && create) { context = createContext(); configure(context); } return context; }
public List<RouteDefinition> getRouteDefinitionList() { return contextElement.getRoutes(); }
private static List<RouteDefinition> processCamelContextElement(CamelContextFactoryBean camelContextFactoryBean, SwitchYardCamelContext camelContext) throws Exception { if (camelContext != null) { if (camelContextFactoryBean.getEndpoints() != null) { // processing camelContext/endpoint for (CamelEndpointFactoryBean epBean : camelContextFactoryBean.getEndpoints()) { epBean.setCamelContext(camelContext); camelContext.getWritebleRegistry().put(epBean.getId(), epBean.getObject()); } } if (camelContextFactoryBean.getDataFormats() != null) { // processing camelContext/dataFormat for (DataFormatDefinition dataFormatDef : camelContextFactoryBean.getDataFormats().getDataFormats()) { camelContext.getDataFormats().put(dataFormatDef.getId(), dataFormatDef); } } } return camelContextFactoryBean.getRoutes(); }
} else if (object instanceof RoutesDefinition) { justRoutes = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((RoutesDefinition) object).getRoutes()); } else if (object instanceof CamelRouteContextFactoryBean) { routesContext = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((CamelRouteContextFactoryBean) object).getRoutes()); } else if (object instanceof org.apache.camel.blueprint.CamelRouteContextFactoryBean) { routesContext = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((org.apache.camel.blueprint.CamelRouteContextFactoryBean) object).getRoutes()); } else { LOG.warn("Unmarshalled not a CamelContext: {}", object); sc = new CamelContextFactoryBean(); LOG.info(message + " does not contain a CamelContext. Maybe the XML namespace is not spring: '{}' or blueprint: '{}'?", springNS, blueprintNS); return new XmlModel(new CamelContextFactoryBean(), doc, beans, null, CamelNamespaces.springNS, false, false);
List<CamelEndpointFactoryBean> endpoints = contextElement.getEndpoints(); List<String> uris = new LinkedList<String>(); if (endpoints != null) {
public List<RouteDefinition> getRouteDefinitionList() { return contextElement.getRoutes(); }
} else if (object instanceof RoutesDefinition) { justRoutes = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((RoutesDefinition) object).getRoutes()); } else if (object instanceof CamelRouteContextFactoryBean) { routesContext = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((CamelRouteContextFactoryBean) object).getRoutes()); } else if (object instanceof org.apache.camel.blueprint.CamelRouteContextFactoryBean) { routesContext = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((org.apache.camel.blueprint.CamelRouteContextFactoryBean) object).getRoutes()); } else { LOG.warn("Unmarshalled not a CamelContext: {}", object); sc = new CamelContextFactoryBean(); LOG.info(message + " does not contain a CamelContext. Maybe the XML namespace is not spring: '{}' or blueprint: '{}'?", springNS, blueprintNS); return new XmlModel(new CamelContextFactoryBean(), doc, beans, null, CamelNamespaces.springNS, false, false);
List<CamelEndpointFactoryBean> endpoints = contextElement.getEndpoints(); List<String> uris = new LinkedList<String>(); if (endpoints != null) {
public void copyRoutesToElement(List<RouteDefinition> routeDefinitionList, CamelContextFactoryBean contextElement) { List<RouteDefinition> routes = contextElement.getRoutes(); routes.clear(); routes.addAll(routeDefinitionList); }
public void copyRoutesToElement(List<RouteDefinition> routeDefinitionList, CamelContextFactoryBean contextElement) { List<RouteDefinition> routes = contextElement.getRoutes(); routes.clear(); routes.addAll(routeDefinitionList); }
public CamelContext camelContext() throws Exception { return createContext(contextElement.getRoutes()); }
public CamelContext camelContext() throws Exception { return createContext(contextElement.getRoutes()); }
/** * Returns the root element to be marshalled as XML * * @return */ public Object marshalRootElement() { if (justRoutes) { RoutesDefinition routes = new RoutesDefinition(); routes.setRoutes(contextElement.getRoutes()); return routes; } else { return contextElement; } }
/** * Returns the root element to be marshalled as XML * * @return */ public Object marshalRootElement() { if (justRoutes) { RoutesDefinition routes = new RoutesDefinition(); routes.setRoutes(contextElement.getRoutes()); return routes; } else { return contextElement; } }