當前位置: 首頁>>代碼示例>>Java>>正文


Java EndpointRegistry類代碼示例

本文整理匯總了Java中org.apache.camel.spi.EndpointRegistry的典型用法代碼示例。如果您正苦於以下問題:Java EndpointRegistry類的具體用法?Java EndpointRegistry怎麽用?Java EndpointRegistry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EndpointRegistry類屬於org.apache.camel.spi包,在下文中一共展示了EndpointRegistry類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: endpointStatistics

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
@Override
public TabularData endpointStatistics() {
    try {
        TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listRuntimeEndpointsTabularType());

        EndpointRegistry staticRegistry = getContext().getEndpointRegistry();
        int index = 0;

        for (RuntimeEndpointRegistry.Statistic stat : registry.getEndpointStatistics()) {
            CompositeType ct = CamelOpenMBeanTypes.listRuntimeEndpointsCompositeType();

            String url = stat.getUri();
            Boolean isStatic = staticRegistry.isStatic(url);
            Boolean isDynamic = staticRegistry.isDynamic(url);
            if (sanitize) {
                url = URISupport.sanitizeUri(url);
            }
            String routeId = stat.getRouteId();
            String direction = stat.getDirection();
            long hits = stat.getHits();

            CompositeData data = new CompositeDataSupport(ct, new String[]{"index", "url", "routeId", "direction", "static", "dynamic", "hits"},
                    new Object[]{index, url, routeId, direction, isStatic, isDynamic, hits});
            answer.put(data);

            // use a counter as the single index in the TabularData as we do not want a multi-value index
            index++;
        }
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:34,代碼來源:ManagedRuntimeEndpointRegistry.java

示例2: getEndpointRuntimeStatistics

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
public List<Map<String, String>> getEndpointRuntimeStatistics(String camelContextName) throws Exception {
    List<Map<String, String>> answer = new ArrayList<Map<String, String>>();

    if (camelContextName != null) {
        CamelContext context = this.getLocalCamelContext(camelContextName);
        if (context != null) {
            EndpointRegistry staticRegistry = context.getEndpointRegistry();
            for (RuntimeEndpointRegistry.Statistic stat : context.getRuntimeEndpointRegistry().getEndpointStatistics()) {

                String url = stat.getUri();
                String routeId = stat.getRouteId();
                String direction = stat.getDirection();
                Boolean isStatic = staticRegistry.isStatic(url);
                Boolean isDynamic = staticRegistry.isDynamic(url);
                long hits = stat.getHits();

                Map<String, String> row = new LinkedHashMap<String, String>();
                row.put("camelContextName", context.getName());
                row.put("uri", url);
                row.put("routeId", routeId);
                row.put("direction", direction);
                row.put("static", isStatic.toString());
                row.put("dynamic", isDynamic.toString());
                row.put("hits", "" + hits);
                answer.add(row);
            }
        }

        // sort the list
        Collections.sort(answer, new Comparator<Map<String, String>>() {
            @Override
            public int compare(Map<String, String> endpoint1, Map<String, String> endpoint2) {
                // sort by route id
                String route1 = endpoint1.get("routeId");
                String route2 = endpoint2.get("routeId");
                int num = route1.compareTo(route2);
                if (num == 0) {
                    // we want in before out
                    String dir1 = endpoint1.get("direction");
                    String dir2 = endpoint2.get("direction");
                    num = dir1.compareTo(dir2);
                }
                return num;
            }

        });
    }
    return answer;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:50,代碼來源:AbstractLocalCamelController.java

示例3: ManagedEndpointRegistry

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
public ManagedEndpointRegistry(CamelContext context, EndpointRegistry endpointRegistry) {
    super(context, endpointRegistry);
    this.endpointRegistry = endpointRegistry;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:5,代碼來源:ManagedEndpointRegistry.java

示例4: getEndpointRegistry

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
public EndpointRegistry getEndpointRegistry() {
    return endpointRegistry;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:ManagedEndpointRegistry.java

示例5: getEndpointRegistry

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
public EndpointRegistry getEndpointRegistry() {
    return endpoints;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:DefaultCamelContext.java

示例6: getEndpointRegistry

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
@Override
public EndpointRegistry<String> getEndpointRegistry() {
  return context.getEndpointRegistry();
}
 
開發者ID:rvs-fluid-it,項目名稱:microservice-bundle,代碼行數:5,代碼來源:ManagedCamelContext.java

示例7: getEndpointRegistry

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
@Override
public EndpointRegistry<String> getEndpointRegistry() {
    return context.getEndpointRegistry();
}
 
開發者ID:commercehub-oss,項目名稱:dropwizard-camel,代碼行數:5,代碼來源:ManagedCamelContext.java

示例8: getEndpointRegistry

import org.apache.camel.spi.EndpointRegistry; //導入依賴的package包/類
/**
 * Gets the {@link org.apache.camel.spi.EndpointRegistry}
 */
EndpointRegistry<String> getEndpointRegistry();
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:5,代碼來源:CamelContext.java


注:本文中的org.apache.camel.spi.EndpointRegistry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。