¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.util; |
| | | |
| | | import org.apache.cxf.Bus; |
| | | import org.apache.cxf.bus.CXFBusFactory; |
| | | import org.apache.cxf.endpoint.EndpointImplFactory; |
| | | import org.apache.cxf.endpoint.dynamic.DynamicClientFactory; |
| | | import org.apache.cxf.jaxws.support.JaxWsEndpointImplFactory; |
| | | |
| | | import java.io.File; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/14 11:07 |
| | | * 注ï¼è§£å³æ¤ï¼é误ï¼ç¼ç GBKçä¸å¯æ å°å符ï¼é®é¢ |
| | | */ |
| | | public class JaxWsDynamicClientFactory extends DynamicClientFactory { |
| | | |
| | | protected JaxWsDynamicClientFactory(Bus bus) { |
| | | super(bus); |
| | | } |
| | | |
| | | @Override |
| | | protected EndpointImplFactory getEndpointImplFactory() { |
| | | return JaxWsEndpointImplFactory.getSingleton(); |
| | | } |
| | | |
| | | protected boolean allowWrapperOps() { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * Create a new instance using a specific <tt>Bus</tt>. |
| | | * |
| | | * @param b the <tt>Bus</tt> to use in subsequent operations with the |
| | | * instance |
| | | * @return the new instance |
| | | */ |
| | | public static JaxWsDynamicClientFactory newInstance(Bus b) { |
| | | return new JaxWsDynamicClientFactory(b); |
| | | } |
| | | |
| | | /** |
| | | * Create a new instance using a default <tt>Bus</tt>. |
| | | * |
| | | * @return the new instance |
| | | */ |
| | | public static JaxWsDynamicClientFactory newInstance() { |
| | | Bus bus = CXFBusFactory.getThreadDefaultBus(); |
| | | return new JaxWsDynamicClientFactory(bus); |
| | | } |
| | | |
| | | /** |
| | | * è¦åç¶ç±»çè¯¥æ¹æ³<br/> |
| | | * 注ï¼è§£å³æ¤ï¼é误ï¼ç¼ç GBKçä¸å¯æ å°å符ï¼é®é¢ |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | protected boolean compileJavaSrc(String classPath, List<File> srcList, String dest) { |
| | | org.apache.cxf.common.util.Compiler javaCompiler |
| | | = new org.apache.cxf.common.util.Compiler(); |
| | | |
| | | // 设置ç¼è¯ç¼ç æ ¼å¼ï¼æ¤å¤ä¸ºæ°å¢ä»£ç ï¼ |
| | | javaCompiler.setEncoding("UTF-8"); |
| | | |
| | | javaCompiler.setClassPath(classPath); |
| | | javaCompiler.setOutputDir(dest); |
| | | javaCompiler.setTarget("1.6"); |
| | | |
| | | return javaCompiler.compileFiles(srcList); |
| | | } |
| | | } |