package org.apache.cxf.bus.spring;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

import com.github.sbugat.samplerest.config.CoreConfiguration;

/**
 * CXF Spring configuration based on CXF core cxf.xml file.
 *
 * Used package is org.apache.cxf.bus.spring instead of applicative one because of package-protected constructor in Jsr250BeanPostProcessor class.
 *
 * @author Sylvain Bugat
 * @see org.apache.cxf.bus.spring.Jsr250BeanPostProcessor
 */
@Import(CoreConfiguration.class)
public class CXFCoreConfiguration {

	/**
	 * Construct the main CXF Spring bus.
	 *
	 * @return CXF Spring bus
	 */
	@Bean(destroyMethod = "shutdown")
	public SpringBus cxf() {
		return new SpringBus();
	}

	/**
	 * Construct the post processor bean to wire CXF bus.
	 *
	 * @return CXF Post processor
	 */
	@Bean(name = "org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor")
	public BusWiringBeanFactoryPostProcessor busWiringBeanFactoryPostProcessor() {
		return new BusWiringBeanFactoryPostProcessor();
	}

	/**
	 * Construct the CXF bus extension post processor.
	 *
	 * @return CXF Bus extension post processor
	 */
	@Bean(name = "org.apache.cxf.bus.spring.BusExtensionPostProcessor")
	public BusExtensionPostProcessor busExtensionPostProcessor() {
		return new BusExtensionPostProcessor();
	}

	/**
	 * Construct the annotation (JSR 250) post processor.
	 *
	 * @return CXF annotation post processor
	 */

	@Bean(name = "org.apache.cxf.bus.spring.Jsr250BeanPostProcessor")
	public Jsr250BeanPostProcessor jsr250BeanPostProcessor() {
		return new Jsr250BeanPostProcessor();
	}

}

@@ -1121,25 +1121,28 @@
 the 
-CXF bus extension
+annotation (JSR 250)
  pos
@@ -1180,18 +1180,15 @@
 CXF 
-Bus extens
+annotat
 ion 
@@ -1201,32 +1201,34 @@
 rocessor%0D%0A%09 */%0D%0A
+%0D%0A
 %09@Bean(name = %22o
@@ -1252,27 +1252,25 @@
 .spring.
-BusExtensio
+Jsr250Bea
 nPostPro
@@ -1287,27 +1287,25 @@
 %09public 
-BusExtensio
+Jsr250Bea
 nPostPro
@@ -1315,19 +1315,17 @@
 sor 
-busExtensio
+jsr250Bea
 nPos
@@ -1357,19 +1357,17 @@
 new 
-BusExtensio
+Jsr250Bea
 nPos
@@ -1411,36 +1411,33 @@
 uct the 
-annotation (JSR 250)
+CXF bus extension
  post pr
@@ -1459,39 +1459,42 @@
 %09 * @return CXF 
-annotat
+Bus extens
 ion post process
@@ -1495,34 +1495,32 @@
 rocessor%0D%0A%09 */%0D%0A
-%0D%0A
 %09@Bean(name = %22o
@@ -1540,33 +1540,35 @@
 .bus.spring.
-Jsr250Bea
+BusExtensio
 nPostProcess
@@ -1577,33 +1577,35 @@
 %22)%0D%0A%09public 
-Jsr250Bea
+BusExtensio
 nPostProcess
@@ -1603,33 +1603,35 @@
 stProcessor 
-jsr250Bea
+busExtensio
 nPostProcess
@@ -1647,33 +1647,35 @@
 %09return new 
-Jsr250Bea
+BusExtensio
 nPostProcess
@@ -1685,13 +1685,11 @@
 );%0D%0A%09%7D%0D%0A
-%0D%0A
 %7D%0D%0A

Reorder CXF bean to reflet cxf.xml