当前位置: 首页>>代码示例>>Java>>正文


Java Endpoint.getEndpointUri方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:24,代码来源:ManagedEndpointRegistry.java

示例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);
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:DeferServiceStartupListener.java

示例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();
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:FromDefinition.java

示例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!";
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:12,代码来源:FromDefinition.java

示例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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:39,代码来源:ProducerCache.java

示例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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:41,代码来源:ConsumerCache.java

示例7: setDeadLetter

import org.apache.camel.Endpoint; //导入方法依赖的package包/类
public void setDeadLetter(Endpoint deadLetter) {
    this.deadLetter = deadLetter;
    this.deadLetterUri = deadLetter.getEndpointUri();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:DefaultErrorHandlerBuilder.java

示例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;
}
 
开发者ID:vert-x3,项目名称:vertx-camel-bridge,代码行数:11,代码来源:CamelMapping.java


注:本文中的org.apache.camel.Endpoint.getEndpointUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。