use of org.apache.cxf.endpoint.ServerRegistry in project cxf by apache.
the class StopEndpointCommand method execute.
@Override
public Object execute() throws Exception {
Bus b = getBus(busName);
ServerRegistry reg = b.getExtension(ServerRegistry.class);
List<Server> servers = reg.getServers();
for (Server serv : servers) {
if (endpoint.equals(serv.getEndpoint().getEndpointInfo().getName().getLocalPart())) {
serv.stop();
}
}
return null;
}
use of org.apache.cxf.endpoint.ServerRegistry in project cxf by apache.
the class EndpointCompleterSupport method complete.
@Override
public int complete(Session session, CommandLine commandLine, List<String> list) {
StringsCompleter delegate = new StringsCompleter();
try {
List<Bus> busses = getBusses();
for (Bus b : busses) {
ServerRegistry reg = b.getExtension(ServerRegistry.class);
List<Server> servers = reg.getServers();
for (Server serv : servers) {
if (acceptsFeature(serv)) {
String qname = serv.getEndpoint().getEndpointInfo().getName().getLocalPart();
delegate.getStrings().add(qname);
}
}
}
} catch (Exception e) {
// Ignore
}
return delegate.complete(session, commandLine, list);
}
use of org.apache.cxf.endpoint.ServerRegistry in project cxf by apache.
the class NoSpringServletClientTest method startServer.
private void startServer() {
ServerRegistry reg = serverBus.getExtension(ServerRegistry.class);
List<Server> servers = reg.getServers();
for (Server serv : servers) {
serv.start();
}
}
use of org.apache.cxf.endpoint.ServerRegistry in project cxf by apache.
the class NoSpringServletClientTest method stopServer.
private void stopServer() {
ServerRegistry reg = serverBus.getExtension(ServerRegistry.class);
List<Server> servers = reg.getServers();
for (Server serv : servers) {
serv.stop();
}
}
use of org.apache.cxf.endpoint.ServerRegistry in project cxf by apache.
the class EngineLifecycleTest method testUpDownWithServlets.
@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();
}
}
Aggregations