Author: jstrachan Date: Fri Oct 19 13:39:56 2012 New Revision: 1400095 URL: http://svn.apache.org/viewvc?rev=1400095&view=rev Log: added a little interface so its easy to discover a binding on an endpoint
Added: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/HasBinding.java (with props) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/binding/BindingEndpoint.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/binding/BindingEndpoint.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/binding/BindingEndpoint.java?rev=1400095&r1=1400094&r2=1400095&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/component/binding/BindingEndpoint.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/binding/BindingEndpoint.java Fri Oct 19 13:39:56 2012 @@ -25,6 +25,7 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.impl.DefaultEndpoint; import org.apache.camel.spi.Binding; +import org.apache.camel.spi.HasBinding; import org.apache.camel.util.ExchangeHelper; /** @@ -32,7 +33,7 @@ import org.apache.camel.util.ExchangeHel * before its sent to the endpoint and processes messages received by the endpoint consumer before its passed * to the real consumer. */ -public class BindingEndpoint extends DefaultEndpoint { +public class BindingEndpoint extends DefaultEndpoint implements HasBinding { private final Binding binding; private final Endpoint delegate; @@ -58,6 +59,7 @@ public class BindingEndpoint extends Def return true; } + @Override public Binding getBinding() { return binding; } Added: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/HasBinding.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/HasBinding.java?rev=1400095&view=auto ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/HasBinding.java (added) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/HasBinding.java Fri Oct 19 13:39:56 2012 @@ -0,0 +1,32 @@ +/** + * + * 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. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.spi; + +/** + * Allows objects such as Endpoints to expose that they have a + * <a href="http://camel.apache.org/binding.html">Binding</a>. + * + * For example bean or cxf endpoints can expose the internal binding metadata at runtime + */ +public interface HasBinding { + + /** + * Returns the binding for this endpoint if one can be deduced or is associated + */ + Binding getBinding(); +} Propchange: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/HasBinding.java ------------------------------------------------------------------------------ svn:eol-style = native