Search in sources :

Example 16 with ServerRegistry

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;
}
Also used : Bus(org.apache.cxf.Bus) Server(org.apache.cxf.endpoint.Server) ServerRegistry(org.apache.cxf.endpoint.ServerRegistry)

Example 17 with ServerRegistry

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);
}
Also used : Bus(org.apache.cxf.Bus) Server(org.apache.cxf.endpoint.Server) StringsCompleter(org.apache.karaf.shell.support.completers.StringsCompleter) ServerRegistry(org.apache.cxf.endpoint.ServerRegistry)

Example 18 with ServerRegistry

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();
    }
}
Also used : Server(org.apache.cxf.endpoint.Server) ServerRegistry(org.apache.cxf.endpoint.ServerRegistry)

Example 19 with ServerRegistry

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();
    }
}
Also used : Server(org.apache.cxf.endpoint.Server) ServerRegistry(org.apache.cxf.endpoint.ServerRegistry)

Example 20 with ServerRegistry

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();
    }
}
Also used : Bus(org.apache.cxf.Bus) WebAppContext(org.eclipse.jetty.webapp.WebAppContext) ServerImpl(org.apache.cxf.endpoint.ServerImpl) JettyHTTPServerEngine(org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine) ServerRegistry(org.apache.cxf.endpoint.ServerRegistry) Handler(org.eclipse.jetty.server.Handler) JettyHTTPDestination(org.apache.cxf.transport.http_jetty.JettyHTTPDestination) Test(org.junit.Test)

Aggregations

ServerRegistry (org.apache.cxf.endpoint.ServerRegistry)23 Server (org.apache.cxf.endpoint.Server)18 Bus (org.apache.cxf.Bus)13 ArrayList (java.util.ArrayList)5 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)5 HashMap (java.util.HashMap)4 Endpoint (org.apache.cxf.endpoint.Endpoint)4 Test (org.junit.Test)4 Fault (org.apache.cxf.interceptor.Fault)3 List (java.util.List)2 PostConstruct (javax.annotation.PostConstruct)2 JMException (javax.management.JMException)2 QName (javax.xml.namespace.QName)2 ManagedEndpoint (org.apache.cxf.endpoint.ManagedEndpoint)2 InterceptorChain (org.apache.cxf.interceptor.InterceptorChain)2 JAASAuthenticationFilter (org.apache.cxf.jaxrs.security.JAASAuthenticationFilter)2 InstrumentationManager (org.apache.cxf.management.InstrumentationManager)2 InstrumentationManagerImpl (org.apache.cxf.management.jmx.InstrumentationManagerImpl)2 Exchange (org.apache.cxf.message.Exchange)2 SamlHeaderInHandler (org.apache.cxf.rs.security.saml.SamlHeaderInHandler)2