Refine search
EndpointInfo endpointInfo = serv.getEndpoint().getEndpointInfo(); if (endpointInfo.getAddress() == null || !endpointInfo.getAddress().contains(addr)) { endpointInfo.setAddress(addr); serv.start(); publishable = false; } catch (Exception ex) {
public void destroy() { stop(); // we should shutdown the destination here getDestination().shutdown(); if (null != serverRegistry) { LOG.fine("unregister the server to serverRegistry "); serverRegistry.unregister(this); } if (iMgr != null) { try { iMgr.unregister(mep); } catch (JMException jmex) { LOG.log(Level.WARNING, "Unregistering ManagedEndpoint failed.", jmex); } iMgr = null; } }
public ServerImpl(Bus bus, Endpoint endpoint, DestinationFactory destinationFactory, BindingFactory bindingFactory) throws BusException, IOException { this.endpoint = endpoint; this.bus = bus; this.bindingFactory = bindingFactory; initDestination(destinationFactory); }
private void initDestination(DestinationFactory destinationFactory) throws BusException, IOException { EndpointInfo ei = endpoint.getEndpointInfo(); serverRegistry = bus.getExtension(ServerRegistry.class); mep = createManagedEndpoint();
private Endpoint publishEndpoint(boolean autoRewriteSoapAddress) { Endpoint endpoint = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/GreeterPort", new GreeterImpl()); EndpointInfo ei = ((EndpointImpl)endpoint).getServer().getEndpoint().getEndpointInfo(); ei.setProperty("autoRewriteSoapAddress", autoRewriteSoapAddress); return endpoint; } }
getOutFaultInterceptors()); ep.getInInterceptors().addAll(getInInterceptors()); ep.getInFaultInterceptors().addAll(getInFaultInterceptors()); ep.getOutInterceptors().addAll(getOutInterceptors()); ep.getOutFaultInterceptors().addAll(getOutFaultInterceptors()); removeDatabindingInterceptprs(); addRMFeatureRequiredInterceptors(); server = new ServerImpl(getBus(), ep, null, chain); super.validate(); } catch (DeploymentException e) {
server); server = new ServerImpl(getBus(), ep, getDestinationFactory(), ep.getService().setInvoker(createInvoker()); } else { ep.getService().setInvoker(invoker); ep.put(Application.class.getName(), appProvider); factory.setRequestPreprocessor( new RequestPreprocessor(languageMappings, extensionMappings));
protected void initDefaultServant() { servant = new NumberImpl(); String wsdlLocation = "testutils/factory_pattern.wsdl"; String bindingId = null; EndpointImpl ep = new EndpointImpl(bus, servant, bindingId, wsdlLocation); ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort")); ep.publish(getServantAddressRoot()); endpoints.add(ep); templateEpr = ep.getServer().getDestination().getAddress(); // jms port EmbeddedJMSBrokerLauncher.updateWsdlExtensors(bus, wsdlLocation); ep = new EndpointImpl(bus, servant, bindingId, wsdlLocation); ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPortJMS")); ep.setAddress("jms:jndi:dynamicQueues/test.cxf.factory_pattern.queue"); ep.publish(); ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor()); ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor()); endpoints.add(ep); }
@PostConstruct public Server create() { try { initializeDispatcher(); Endpoint ep = createEndpoint(); server = new ServerImpl(getBus(), ep, getDestinationFactory(), getBindingFactory()); if (invoker == null) { ep.getService().setInvoker(createInvoker()); } else { ep.getService().setInvoker(invoker); } server.start(); } catch (EndpointException e) { throw new ServiceConstructionException(e); } catch (BusException e) { throw new ServiceConstructionException(e); } catch (IOException e) { throw new ServiceConstructionException(e); } applyFeatures(); return server; }
protected void run() { Object implementor = new TestMtomImpl(); String address = "http://localhost:" + PORT + "/mime-test"; String addressProvider = "http://localhost:" + PORT + "/mime-test-provider"; try { jaxep = (EndpointImpl) javax.xml.ws.Endpoint.publish(address, implementor); Endpoint ep = jaxep.getServer().getEndpoint(); ep.getInInterceptors().add(new TestMultipartMessageInterceptor()); ep.getOutInterceptors().add(new TestAttachmentOutInterceptor()); jaxep.getInInterceptors().add(new LoggingInInterceptor()); jaxep.getOutInterceptors().add(new LoggingOutInterceptor()); SOAPBinding jaxWsSoapBinding = (SOAPBinding) jaxep.getBinding(); jaxWsSoapBinding.setMTOMEnabled(true); EndpointImpl endpoint = (EndpointImpl)javax.xml.ws.Endpoint.publish(addressProvider, new TestMtomProviderImpl()); endpoint.getProperties().put("schema-validation-enabled", "true"); endpoint.getInInterceptors().add(new LoggingInInterceptor()); endpoint.getOutInterceptors().add(new LoggingOutInterceptor()); } catch (Exception e) { Thread.currentThread().interrupt(); } } public void tearDown() {
null); server = new ServerImpl(getBus(), ep, getDestinationFactory(), ep.getService().setInvoker(createInvoker()); } else { ep.getService().setInvoker(invoker); ep.put(Application.class.getName(), appProvider); factory.setApplicationProvider(appProvider); factory.setRequestPreprocessor(
private void customizeEndpoint(EndpointConfig config, Endpoint endpoint) { EndpointImpl e = (EndpointImpl) endpoint; // log incoming requests SecureAnnotationsInterceptor sai = new RespiroSecureAnnotationsInterceptor(); sai.setSecuredObject(config.getImplementor()); e.getServer().getEndpoint().getInInterceptors().add(sai); for (EndpointCustomizer customizer : endpointCustomizers) { customizer.customizeEndpoint(endpoint); } }
/** * For both code-first and wsdl-first scenarios, reset the endpoint address * so that it is written to the generated wsdl file. */ private void updateSoapAddress() { final SOAPAddressRewriteMetadata metadata = getSOAPAddressRewriteMetadata(); if (metadata.isModifySOAPAddress()) { //- code-first handling List<ServiceInfo> sevInfos = getServer().getEndpoint().getService().getServiceInfos(); for (ServiceInfo si: sevInfos){ Collection<EndpointInfo > epInfos = si.getEndpoints(); for(EndpointInfo ei: epInfos){ String publishedEndpointUrl = (String)ei.getProperty(WSDLGetUtils.PUBLISHED_ENDPOINT_URL); if (publishedEndpointUrl != null){ ei.setAddress(publishedEndpointUrl); } else { //- wsdl-first handling if (ei.getAddress().contains(ServerConfig.UNDEFINED_HOSTNAME)) { String epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(ei.getAddress(), metadata); ei.setAddress(epurl); } } } } } } }
protected Server() throws Exception { System.out.println("Starting Server"); Object implementor = new GreeterImpl(); String address = "http://localhost:8080/services/InterceptorExample"; Endpoint endpoint = Endpoint.create(implementor); // Add the DemoInterceptor's to print the contents DemoInterceptor.addInterceptors(((EndpointImpl)endpoint).getServer().getEndpoint().getBinding()); endpoint.publish(address); }
protected void run() { setBus(BusFactory.getDefaultBus()); getBus().getInInterceptors().add(new LoggingInInterceptor()); String address = "http://localhost:" + PORT + "/SoapContext/SoapPort"; Object implementor1 = new GreeterImplMixedStyle(" version1"); EndpointImpl ep1 = (EndpointImpl) Endpoint.publish(address, implementor1); ep1.getServer().getEndpoint().put("version", "1"); ep1.getServer().getEndpoint().put("allow-multiplex-endpoint", Boolean.TRUE); //Register a MediatorInInterceptor on this dummy service Object implementor2 = new GreeterImplMixedStyle(" version2"); EndpointImpl ep2 = (EndpointImpl) Endpoint.publish(address, implementor2); ep2.getServer().getEndpoint().put("version", "2"); MultipleEndpointObserver meo = (MultipleEndpointObserver) ep1.getServer().getDestination().getMessageObserver(); meo.getRoutingInterceptors().clear(); meo.getRoutingInterceptors().add(new MediatorInInterceptor()); }
org.apache.cxf.endpoint.Endpoint getEndpoint() { return getServer(null).getEndpoint(); }
public void stop() { if (stopped) { return; } LOG.fine("Server is stopping."); if (slcMgr != null) { slcMgr.stopServer(this); } MessageObserver mo = getDestination().getMessageObserver(); if (mo instanceof MultipleEndpointObserver) { ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint); if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) { getDestination().setMessageObserver(null); } } else { getDestination().setMessageObserver(null); } stopped = true; }
public void stop() { if (stopped) { return; } LOG.fine("Server is stopping."); for (Closeable c : endpoint.getCleanupHooks()) { try { c.close(); } catch (IOException e) { //ignore } } if (slcMgr != null) { slcMgr.stopServer(this); } MessageObserver mo = getDestination().getMessageObserver(); if (mo instanceof MultipleEndpointObserver) { ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint); if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) { getDestination().setMessageObserver(null); } } else { getDestination().setMessageObserver(null); } stopped = true; }
private Server server = new ServerImpl(); public void doIt() throws ClientException { try { private Server server = new ServerImpl(); public void doIt() { try {
private void initDestination(DestinationFactory destinationFactory) throws BusException, IOException { EndpointInfo ei = endpoint.getEndpointInfo(); serverRegistry = bus.getExtension(ServerRegistry.class); mep = createManagedEndpoint();