Updated Branches: refs/heads/master 4cc51e1c6 -> 9e31679fc
Fixed CS. Polished javadoc. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9e31679f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9e31679f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9e31679f Branch: refs/heads/master Commit: 9e31679fcd35b572fa687c5664237bb2f101856c Parents: 4cc51e1 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri May 24 13:17:10 2013 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri May 24 13:17:10 2013 +0200 ---------------------------------------------------------------------- .../management/mbean/ManagedCamelContextMBean.java | 8 ++++++-- .../org/apache/camel/spi/EndpointCompleter.java | 7 +++---- .../camel/management/EndpointCompletionTest.java | 13 ++----------- 3 files changed, 11 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/9e31679f/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java index ea4e8b9..4adbc30 100644 --- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java +++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java @@ -194,12 +194,16 @@ public interface ManagedCamelContextMBean extends ManagedPerformanceCounterMBean /** * Helper method for tooling which returns the completion list of the endpoint path * from the given endpoint name, properties and current path expression. - * + * <p/> * For example if using the file endpoint, this should complete a list of files (rather like bash completion) * or for an ActiveMQ component this should complete the list of queues or topics. * + * @param componentName the component name + * @param endpointParameters parameters of the endpoint + * @param completionText the entered text which we want to have completion suggestions for + * @throws Exception is thrown if error occurred */ @ManagedOperation(description = "Returns the list of available endpoint paths for the given component name, endpoint properties and completion text") - List<String> completeEndpointPath(String componentName, Map<String,Object> endpointParameters, String completionText) throws Exception; + List<String> completeEndpointPath(String componentName, Map<String, Object> endpointParameters, String completionText) throws Exception; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/9e31679f/camel-core/src/main/java/org/apache/camel/spi/EndpointCompleter.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/spi/EndpointCompleter.java b/camel-core/src/main/java/org/apache/camel/spi/EndpointCompleter.java index 2fd34ec..3f634fe 100644 --- a/camel-core/src/main/java/org/apache/camel/spi/EndpointCompleter.java +++ b/camel-core/src/main/java/org/apache/camel/spi/EndpointCompleter.java @@ -1,5 +1,4 @@ /** - * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -7,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -29,6 +28,7 @@ import org.apache.camel.ComponentConfiguration; * behave nicer in command line, IDE and web based tools. */ public interface EndpointCompleter { + /** * Given the configuration and completion text, return a list of possible completion values * for a command line, IDE or web based tool. @@ -36,6 +36,5 @@ public interface EndpointCompleter { * @returns the list of completion values if any (rather like bash completion, prefix values can be returned * - such as just the directories in the current path rather than returning every possible file name on a disk). */ - List<String> completeEndpointPath(ComponentConfiguration configuration, - String completionText); + List<String> completeEndpointPath(ComponentConfiguration configuration, String completionText); } http://git-wip-us.apache.org/repos/asf/camel/blob/9e31679f/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java b/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java index fff57b8..51a8044 100644 --- a/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java +++ b/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java @@ -18,17 +18,10 @@ package org.apache.camel.management; import java.util.HashMap; import java.util.List; -import java.util.Set; -import javax.management.InstanceNotFoundException; -import javax.management.MBeanException; import javax.management.MBeanServer; import javax.management.ObjectName; -import javax.management.ReflectionException; - -import com.sun.javafx.tools.packager.Log; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,14 +43,12 @@ public class EndpointCompletionTest extends ManagementTestSupport { completions = assertCompletion(mbeanServer, on, componentName, properties, "/usr/local"); completions = assertCompletion(mbeanServer, on, componentName, properties, "/usr/local/"); completions = assertCompletion(mbeanServer, on, componentName, properties, "/usr/local/b"); - } private List<String> assertCompletion(MBeanServer mbeanServer, ObjectName on, String componentName, - HashMap<String, Object> properties, String completionText) - throws InstanceNotFoundException, MBeanException, ReflectionException { + HashMap<String, Object> properties, String completionText) throws Exception { Object[] params = {componentName, properties, completionText}; - String[] signature = { "java.lang.String", "java.util.Map", "java.lang.String" }; + String[] signature = {"java.lang.String", "java.util.Map", "java.lang.String"}; List completions = assertIsInstanceOf(List.class, mbeanServer.invoke(on, "completeEndpointPath", params, signature));