本文整理匯總了Java中org.apache.camel.spring.CamelEndpointFactoryBean類的典型用法代碼示例。如果您正苦於以下問題:Java CamelEndpointFactoryBean類的具體用法?Java CamelEndpointFactoryBean怎麽用?Java CamelEndpointFactoryBean使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CamelEndpointFactoryBean類屬於org.apache.camel.spring包,在下文中一共展示了CamelEndpointFactoryBean類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadSchemas
import org.apache.camel.spring.CamelEndpointFactoryBean; //導入依賴的package包/類
private static void loadSchemas(SchemaFinder loader) throws SAXException, IOException {
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
XsdDetails[] xsds = new XsdDetails[]{
new XsdDetails("camel-spring.xsd", "http://camel.apache.org/schema/spring/camel-spring.xsd", CamelEndpointFactoryBean.class),
new XsdDetails("camel-blueprint.xsd", "http://camel.apache.org/schema/blueprint/camel-blueprint.xsd", org.apache.camel.blueprint.CamelEndpointFactoryBean.class)
};
List<Source> sources = new ArrayList<Source>(xsds.length);
for (XsdDetails xsdd : xsds) {
URL url = loader.findSchema(xsdd);
if (url != null) {
sources.add(new StreamSource(url.openStream(), xsdd.getUri()));
} else {
System.out.println("Warning could not find local resource " + xsdd.getPath() + " on classpath");
sources.add(new StreamSource(xsdd.getUri()));
}
}
_schema = factory.newSchema(sources.toArray(new Source[sources.size()]));
}
示例2: doParse
import org.apache.camel.spring.CamelEndpointFactoryBean; //導入依賴的package包/類
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
doBeforeParse(element);
super.doParse(element, parserContext, builder);
// now lets parse the routes with JAXB
Binder<Node> binder;
try {
binder = getJaxbContext().createBinder();
} catch (JAXBException e) {
throw new BeanDefinitionStoreException("Failed to create the JAXB binder", e);
}
Object value = parseUsingJaxb(element, parserContext, binder);
if (value instanceof CamelEndpointFactoryBean) {
CamelEndpointFactoryBean factoryBean = (CamelEndpointFactoryBean) value;
builder.addPropertyValue("properties", factoryBean.getProperties());
}
}
示例3: processCamelContextElement
import org.apache.camel.spring.CamelEndpointFactoryBean; //導入依賴的package包/類
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();
}
示例4: EndpointDefinitionParser
import org.apache.camel.spring.CamelEndpointFactoryBean; //導入依賴的package包/類
public EndpointDefinitionParser() {
super(CamelEndpointFactoryBean.class, false);
}
示例5: getEndpoints
import org.apache.camel.spring.CamelEndpointFactoryBean; //導入依賴的package包/類
@Override
public List<CamelEndpointFactoryBean> getEndpoints() {
return _factoryBean.getEndpoints();
}