本文整理汇总了Java中org.apache.camel.Endpoint.getEndpointUri方法的典型用法代码示例。如果您正苦于以下问题:Java Endpoint.getEndpointUri方法的具体用法?Java Endpoint.getEndpointUri怎么用?Java Endpoint.getEndpointUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.camel.Endpoint
的用法示例。
在下文中一共展示了Endpoint.getEndpointUri方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listEndpoints
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public TabularData listEndpoints() {
try {
TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listEndpointsTabularType());
Collection<Endpoint> endpoints = endpointRegistry.values();
for (Endpoint endpoint : endpoints) {
CompositeType ct = CamelOpenMBeanTypes.listEndpointsCompositeType();
String url = endpoint.getEndpointUri();
if (sanitize) {
url = URISupport.sanitizeUri(url);
}
boolean fromStatic = endpointRegistry.isStatic(url);
boolean fromDynamic = endpointRegistry.isDynamic(url);
CompositeData data = new CompositeDataSupport(ct, new String[]{"url", "static", "dynamic"}, new Object[]{url, fromStatic, fromDynamic});
answer.put(data);
}
return answer;
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
}
示例2: onCamelContextStarted
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
@Override
public void onCamelContextStarted(CamelContext context, boolean alreadyStarted) throws Exception {
// new services may be added while starting a service
// so use a while loop to get the newly added services as well
while (!services.isEmpty()) {
Service service = services.iterator().next();
try {
ServiceHelper.startService(service);
} catch (Exception e) {
if (service instanceof Endpoint) {
Endpoint endpoint = (Endpoint) service;
throw new ResolveEndpointFailedException(endpoint.getEndpointUri(), e);
} else {
throw e;
}
} finally {
services.remove(service);
}
}
}
示例3: setEndpoint
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
public void setEndpoint(Endpoint endpoint) {
this.endpoint = endpoint;
this.uri = null;
if (endpoint != null) {
this.uri = endpoint.getEndpointUri();
}
}
示例4: description
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
protected static String description(String uri, String ref, Endpoint endpoint) {
if (ref != null) {
return "ref:" + ref;
} else if (endpoint != null) {
return endpoint.getEndpointUri();
} else if (uri != null) {
return uri;
} else {
return "no uri or ref supplied!";
}
}
示例5: doGetProducer
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
protected synchronized Producer doGetProducer(Endpoint endpoint, boolean pooled) {
String key = endpoint.getEndpointUri();
Producer answer = producers.get(key);
if (pooled && answer == null) {
// try acquire from connection pool
answer = pool.acquire(endpoint);
}
if (answer == null) {
// create a new producer
try {
answer = endpoint.createProducer();
// add as service which will also start the service
// (false => we and handling the lifecycle of the producer in this cache)
getCamelContext().addService(answer, false);
} catch (Exception e) {
throw new FailedToCreateProducerException(endpoint, e);
}
// add producer to cache or pool if applicable
if (pooled && answer instanceof ServicePoolAware) {
LOG.debug("Adding to producer service pool with key: {} for producer: {}", endpoint, answer);
answer = pool.addAndAcquire(endpoint, answer);
} else if (answer.isSingleton()) {
LOG.debug("Adding to producer cache with key: {} for producer: {}", endpoint, answer);
producers.put(key, answer);
}
}
if (answer != null) {
// record statistics
if (extendedStatistics) {
statistics.onHit(key);
}
}
return answer;
}
示例6: doGetPollingConsumer
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
protected synchronized PollingConsumer doGetPollingConsumer(Endpoint endpoint, boolean pooled) {
String key = endpoint.getEndpointUri();
PollingConsumer answer = consumers.get(key);
if (pooled && answer == null) {
pool.acquire(endpoint);
}
if (answer == null) {
try {
answer = endpoint.createPollingConsumer();
answer.start();
} catch (Exception e) {
throw new FailedToCreateConsumerException(endpoint, e);
}
if (pooled && answer instanceof ServicePoolAware) {
LOG.debug("Adding to producer service pool with key: {} for producer: {}", endpoint, answer);
answer = pool.addAndAcquire(endpoint, answer);
} else {
boolean singleton = false;
if (answer instanceof IsSingleton) {
singleton = ((IsSingleton) answer).isSingleton();
}
if (singleton) {
LOG.debug("Adding to consumer cache with key: {} for consumer: {}", endpoint, answer);
consumers.put(key, answer);
} else {
LOG.debug("Consumer for endpoint: {} is not singleton and thus not added to consumer cache", key);
}
}
}
if (answer != null) {
// record statistics
if (extendedStatistics) {
statistics.onHit(key);
}
}
return answer;
}
示例7: setDeadLetter
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
public void setDeadLetter(Endpoint deadLetter) {
this.deadLetter = deadLetter;
this.deadLetterUri = deadLetter.getEndpointUri();
}
示例8: setEndpoint
import org.apache.camel.Endpoint; //导入方法依赖的package包/类
/**
* Sets the Camel endpoint. If used, {@link #setUri(String)} does not need to be called.
*
* @param endpoint the endpoint
* @return the current {@link CamelMapping}
*/
public CamelMapping setEndpoint(Endpoint endpoint) {
this.uri = endpoint.getEndpointUri();
return this;
}