Skip to content

Commit

Permalink
[pinpoint-apm#9666] Added WebServiceConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
smilu97 committed May 18, 2023
1 parent 8a3ba8a commit 5271d5b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@
import com.navercorp.pinpoint.web.install.controller.AgentDownloadController;
import com.navercorp.pinpoint.web.install.service.AgentDownLoadService;
import com.navercorp.pinpoint.web.service.ActiveThreadDumpService;
import com.navercorp.pinpoint.web.service.ActiveThreadDumpServiceImpl;
import com.navercorp.pinpoint.web.service.AdminService;
import com.navercorp.pinpoint.web.service.AgentEventService;
import com.navercorp.pinpoint.web.service.AgentInfoService;
import com.navercorp.pinpoint.web.service.AgentService;
import com.navercorp.pinpoint.web.service.AlarmService;
import com.navercorp.pinpoint.web.service.EchoService;
import com.navercorp.pinpoint.web.service.EchoServiceImpl;
import com.navercorp.pinpoint.web.service.FilteredMapService;
import com.navercorp.pinpoint.web.service.HeatMapService;
import com.navercorp.pinpoint.web.service.ScatterChartService;
Expand All @@ -52,7 +49,6 @@
import com.navercorp.pinpoint.web.service.appmetric.ApplicationStatChartService;
import com.navercorp.pinpoint.web.service.stat.AgentStatChartService;
import com.navercorp.pinpoint.web.service.stat.AgentStatService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand Down Expand Up @@ -87,18 +83,6 @@ public AgentStatController<AgentStatDataPoint> createAgentStatController(List<Ag
return new AgentStatController<>(service, agentStatChartServiceList);
}

@Bean
@ConditionalOnMissingBean(ActiveThreadDumpService.class)
public ActiveThreadDumpService activeThreadDumpService(AgentService agentService) {
return new ActiveThreadDumpServiceImpl(agentService);
}

@Bean
@ConditionalOnMissingBean(EchoService.class)
public EchoService echoService(AgentService agentService) {
return new EchoServiceImpl(agentService);
}

@Bean
public AgentCommandController createAgentCommandController(
ConfigProperties webProperties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
WebServerConfig.class,
WebMvcConfig.class,
WebSocketConfig.class,
WebServiceConfig.class,
WebMysqlDataSourceConfiguration.class,
ClusterConfigurationFactory.class,
CacheConfiguration.class,
Expand All @@ -48,7 +49,6 @@
QueryServiceConfiguration.class
})
@ComponentScan(basePackages = {
"com.navercorp.pinpoint.web.service",
"com.navercorp.pinpoint.web.mapper",
"com.navercorp.pinpoint.web.filter",
"com.navercorp.pinpoint.web.view",
Expand Down
47 changes: 47 additions & 0 deletions web/src/main/java/com/navercorp/pinpoint/web/WebServiceConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2023 NAVER Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.navercorp.pinpoint.web;

import com.navercorp.pinpoint.web.service.ActiveThreadDumpService;
import com.navercorp.pinpoint.web.service.ActiveThreadDumpServiceImpl;
import com.navercorp.pinpoint.web.service.AgentService;
import com.navercorp.pinpoint.web.service.EchoService;
import com.navercorp.pinpoint.web.service.EchoServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
* @author youngjin.kim2
*/
@Configuration
@ComponentScan(basePackages = { "com.navercorp.pinpoint.web.service" })
public class WebServiceConfig {

@Bean
@ConditionalOnMissingBean(ActiveThreadDumpService.class)
ActiveThreadDumpService activeThreadDumpService(AgentService agentService) {
return new ActiveThreadDumpServiceImpl(agentService);
}

@Bean
@ConditionalOnMissingBean(EchoService.class)
EchoService echoService(AgentService agentService) {
return new EchoServiceImpl(agentService);
}

}

0 comments on commit 5271d5b

Please sign in to comment.