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."); 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; }
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; }
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 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 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 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 void start() { endpoint = createEndpoint(); endpoint.publish("http://" + getFakeUrl().replace('$', '_') + ":80"); // needs to be unique and with a port destination = (AbstractHTTPDestination) endpoint.getServer().getDestination(); // register an MBean for this endpoint this.jmxName = registerMBean(); }
public void start() { endpoint = createEndpoint(); endpoint.publish("http://" + getFakeUrl() + ":80"); // needs to be unique and with a port destination = (AbstractHTTPDestination) endpoint.getServer().getDestination(); // register an MBean for this endpoint this.jmxName = registerMBean(); }
protected void initDefaultServant() { servant = new HttpNumberImpl(); 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(); } }
protected void initDefaultServant() { servant = new ManualNumberImpl(); 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(); } }
public CXFWebServiceContainer(Bus bus, Object target, Bundle bundle) { this.bus = bus; this.bundle = bundle; List<String> ids = new ArrayList<String>(); ids.add("http://schemas.xmlsoap.org/wsdl/soap/"); DestinationFactoryManager destinationFactoryManager = bus .getExtension(DestinationFactoryManager.class); GeronimoDestinationFactory factory = new GeronimoDestinationFactory(bus); factory.setTransportIds(ids); destinationFactoryManager.registerDestinationFactory( "http://cxf.apache.org/transports/http/configuration", factory); destinationFactoryManager.registerDestinationFactory( "http://cxf.apache.org/bindings/xformat", factory); destinationFactoryManager.registerDestinationFactory( "http://www.w3.org/2003/05/soap/bindings/HTTP/", factory); destinationFactoryManager.registerDestinationFactory( "http://schemas.xmlsoap.org/soap/http", factory); destinationFactoryManager.registerDestinationFactory( "http://schemas.xmlsoap.org/wsdl/http/", factory); destinationFactoryManager.registerDestinationFactory( "http://schemas.xmlsoap.org/wsdl/soap/http", factory); endpoint = publishEndpoint(target); destination = (GeronimoDestination) endpoint.getServer().getDestination(); }
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); }
@Test public void testUpDownWithServlets() throws Exception { setUpBus(); Bus bus = (Bus)applicationContext.getBean("cxf"); ServerRegistry sr = bus.getExtension(ServerRegistry.class); ServerImpl si = (ServerImpl) sr.getServers().get(0); JettyHTTPDestination jhd = (JettyHTTPDestination) si.getDestination(); JettyHTTPServerEngine e = (JettyHTTPServerEngine) jhd.getEngine(); org.eclipse.jetty.server.Server jettyServer = e.getServer(); for (Handler h : jettyServer.getChildHandlersByClass(WebAppContext.class)) { WebAppContext wac = (WebAppContext) h; if ("/jsunit".equals(wac.getContextPath())) { wac.addServlet("org.eclipse.jetty.servlet.DefaultServlet", "/bloop"); break; } } try { verifyStaticHtml(); invokeService(); } finally { shutdownService(); } }
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()); }