當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。