Search in sources :

Example 1 with JettyManagerService

use of org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService in project incubator-skywalking by apache.

the class AgentModuleJettyProvider method start.

@Override
public void start(Properties config) throws ServiceNotProvidedException {
    String host = config.getProperty(HOST);
    Integer port = (Integer) config.get(PORT);
    String contextPath = config.getProperty(CONTEXT_PATH);
    ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class);
    moduleRegisterService.register(AgentJettyModule.NAME, this.name(), new AgentModuleJettyRegistration(host, port, contextPath));
    AgentJettyNamingListener namingListener = new AgentJettyNamingListener();
    ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class);
    moduleListenerService.addListener(namingListener);
    NamingHandlerRegisterService namingHandlerRegisterService = getManager().find(NamingModule.NAME).getService(NamingHandlerRegisterService.class);
    namingHandlerRegisterService.register(new AgentJettyNamingHandler(namingListener));
    JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class);
    JettyServer jettyServer = managerService.createIfAbsent(host, port, contextPath);
    addHandlers(jettyServer);
}
Also used : NamingHandlerRegisterService(org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService) ModuleRegisterService(org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService) JettyServer(org.apache.skywalking.apm.collector.server.jetty.JettyServer) ModuleListenerService(org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService) AgentJettyNamingListener(org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingListener) JettyManagerService(org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService) AgentJettyNamingHandler(org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingHandler)

Example 2 with JettyManagerService

use of org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService in project incubator-skywalking by apache.

the class NamingModuleJettyProvider method start.

@Override
public void start(Properties config) throws ServiceNotProvidedException {
    String host = config.getProperty(HOST);
    Integer port = (Integer) config.get(PORT);
    String contextPath = config.getProperty(CONTEXT_PATH);
    JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class);
    managerService.createIfAbsent(host, port, contextPath);
}
Also used : JettyManagerService(org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService)

Example 3 with JettyManagerService

use of org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService in project incubator-skywalking by apache.

the class NamingJettyHandlerRegisterService method register.

@Override
public void register(ServerHandler namingHandler) {
    if (!(namingHandler instanceof JettyHandler)) {
        throw new IllegalArgumentException("NamingJettyHandlerRegisterService support JettyHandler only.");
    }
    JettyManagerService managerService = moduleManager.find(JettyManagerModule.NAME).getService(JettyManagerService.class);
    managerService.addHandler(this.host, this.port, (JettyHandler) namingHandler);
}
Also used : JettyHandler(org.apache.skywalking.apm.collector.server.jetty.JettyHandler) JettyManagerService(org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService)

Example 4 with JettyManagerService

use of org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService in project incubator-skywalking by apache.

the class UIModuleJettyProvider method start.

@Override
public void start(Properties config) throws ServiceNotProvidedException {
    String host = config.getProperty(HOST);
    Integer port = (Integer) config.get(PORT);
    String contextPath = config.getProperty(CONTEXT_PATH);
    ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class);
    moduleRegisterService.register(UIModule.NAME, this.name(), new UIModuleJettyRegistration(host, port, contextPath));
    UIJettyNamingListener namingListener = new UIJettyNamingListener();
    ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class);
    moduleListenerService.addListener(namingListener);
    NamingHandlerRegisterService namingHandlerRegisterService = getManager().find(NamingModule.NAME).getService(NamingHandlerRegisterService.class);
    namingHandlerRegisterService.register(new UIJettyNamingHandler(namingListener));
    JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class);
    JettyServer jettyServer = managerService.createIfAbsent(host, port, contextPath);
    addHandlers(jettyServer);
}
Also used : NamingHandlerRegisterService(org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService) UIJettyNamingHandler(org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingHandler) ModuleRegisterService(org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService) JettyServer(org.apache.skywalking.apm.collector.server.jetty.JettyServer) UIJettyNamingListener(org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingListener) ModuleListenerService(org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService) JettyManagerService(org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService)

Aggregations

JettyManagerService (org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService)4 ModuleListenerService (org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService)2 ModuleRegisterService (org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService)2 NamingHandlerRegisterService (org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService)2 JettyServer (org.apache.skywalking.apm.collector.server.jetty.JettyServer)2 AgentJettyNamingHandler (org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingHandler)1 AgentJettyNamingListener (org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingListener)1 JettyHandler (org.apache.skywalking.apm.collector.server.jetty.JettyHandler)1 UIJettyNamingHandler (org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingHandler)1 UIJettyNamingListener (org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingListener)1