@Override public void stop() throws Exception { this.started = false; getBus().getExtension(WSDLManager.class).removeDefinition(definition); super.stop(); }
private void deployEndpoints(Collection<EndpointConfig> endpointConfigs) { for (Endpoint endpoint : endpoints) { endpoint.stop(); } endpoints.clear(); WSDLManager wsdlManager = WSDLManagerDefinitionCacheCleaner.getWsdlManager(); for (Definition def : new ArrayList<>(wsdlManager.getDefinitions().values())) { wsdlManager.removeDefinition(def); } for (EndpointConfig config : endpointConfigs) { try { pluginClassLoader.set(config.getClassLoader()); currentConfig.set(config); Endpoint endpoint; try { endpoint = Endpoint.create(config.getImplementor()); configureEndpoint(config, endpoint); endpoint.publish(config.getPath()); } finally { currentConfig.remove(); } customizeEndpoint(config, endpoint); CxfPlugin.this.endpoints.add(endpoint); } finally { pluginClassLoader.remove(); } } }
public void parseWSDL(String wsdlUrl) { try { Bus bus = BusFactory.getThreadDefaultBus(); WSDLManager mgr = bus.getExtension(WSDLManager.class); wsdlDefinition = mgr.getDefinition(wsdlUrl); WSDLServiceBuilder builder = new WSDLServiceBuilder(bus); builder.buildMockServices(wsdlDefinition); schemas = mgr.getSchemasForDefinition(wsdlDefinition); //remove this as we're going to be modifying it mgr.removeDefinition(wsdlDefinition); } catch (WSDLException we) { org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message( "FAIL_TO_CREATE_WSDL_DEFINITION", LOG); throw new ToolException(msg, we); } }
public void customize() { if (!context.containsKey(ToolConstants.CFG_BINDING)) { return; } WSDLManager mgr = bus.getExtension(WSDLManager.class); mgr.removeDefinition(wsdlDefinition); cusParser = new CustomizationParser(); cusParser.parse(context); jaxbBindings = cusParser.getJaxbBindings(); handlerChain = cusParser.getHandlerChains(); context.setJaxbBindingFiles(jaxbBindings); context.put(ToolConstants.HANDLER_CHAIN, handlerChain); try { this.wsdlDefinition = buildCustomizedDefinition(); } catch (Exception e) { Message msg = new Message("FAIL_TO_CREATE_WSDL_DEFINITION", LOG, (String)context.get(ToolConstants.CFG_WSDLURL)); throw new RuntimeException(msg.toString(), e); } }
protected void parseWSDL(String wsdlURL) throws ToolException { Bus bus = env.get(Bus.class); if (bus == null) { bus = BusFactory.getThreadDefaultBus(); env.put(Bus.class, bus); } WSDLDefinitionBuilder builder = new WSDLDefinitionBuilder(bus); wsdlDefinition = builder.build(wsdlURL); if (env.fullValidateWSDL()) { validate(wsdlDefinition, env, bus); } WSDLManager mgr = bus.getExtension(WSDLManager.class); mgr.removeDefinition(wsdlDefinition); wsdlFactory = mgr.getWSDLFactory(); extReg = mgr.getExtensionRegistry(); wsdlPlugins = builder.getWSDLPlugins(); }
protected void parseWSDL(String wsdlURL) throws ToolException { Bus bus = env.get(Bus.class); if (bus == null) { bus = BusFactory.getThreadDefaultBus(); env.put(Bus.class, bus); } WSDLDefinitionBuilder builder = new WSDLDefinitionBuilder(bus); wsdlDefinition = builder.build(wsdlURL); if (env.fullValidateWSDL()) { validate(wsdlDefinition, env, bus); } WSDLManager mgr = bus.getExtension(WSDLManager.class); mgr.removeDefinition(wsdlDefinition); wsdlFactory = mgr.getWSDLFactory(); extReg = mgr.getExtensionRegistry(); wsdlPlugins = builder.getWSDLPlugins(); }
getBus().getExtension(WSDLManager.class).removeDefinition(definition); } else {
getBus().getExtension(WSDLManager.class).removeDefinition(definition); } else {