This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit f1db164bbe75329056687f6df32c8fcc71383cf3 Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Thu Mar 30 16:43:02 2023 +0200 CAMEL-15105: add a plugin helper to simplify converting the code --- .../org/apache/camel/support/PluginHelper.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PluginHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/PluginHelper.java new file mode 100644 index 00000000000..c9713d823d5 --- /dev/null +++ b/core/camel-support/src/main/java/org/apache/camel/support/PluginHelper.java @@ -0,0 +1,46 @@ +/* + * 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.support; + +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.spi.CamelBeanPostProcessor; + +public final class PluginHelper { + private PluginHelper() { + + } + + /** + * Returns the bean post processor used to do any bean customization. + * + * @return the bean post processor. + */ + public static CamelBeanPostProcessor getBeanPostProcessor(CamelContext camelContext) { + return getBeanPostProcessor(camelContext.getCamelContextExtension()); + } + + /** + * Returns the bean post processor used to do any bean customization. + * + * @return the bean post processor. + */ + public static CamelBeanPostProcessor getBeanPostProcessor(ExtendedCamelContext extendedCamelContext) { + return extendedCamelContext.getContextPlugin(CamelBeanPostProcessor.class); + } +}