-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
…ervice
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2024 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.profiler.context.exception; | ||
|
||
import com.navercorp.pinpoint.profiler.context.exception.model.ExceptionContext; | ||
import com.navercorp.pinpoint.profiler.context.exception.model.ExceptionContextFactory; | ||
import com.navercorp.pinpoint.profiler.context.exception.model.ExceptionWrapperFactory; | ||
import com.navercorp.pinpoint.profiler.context.exception.sampler.ExceptionTraceSampler; | ||
import com.navercorp.pinpoint.profiler.context.id.TraceRoot; | ||
|
||
import java.util.Objects; | ||
|
||
public class DefaultExceptionRecordingServiceFactory implements ExceptionRecordingServiceFactory { | ||
|
||
private final ExceptionTraceSampler exceptionTraceSampler; | ||
private final ExceptionWrapperFactory exceptionWrapperFactory; | ||
private final ExceptionContextFactory exceptionContextFactory; | ||
|
||
public DefaultExceptionRecordingServiceFactory(ExceptionTraceSampler exceptionTraceSampler, | ||
ExceptionWrapperFactory exceptionWrapperFactory, | ||
ExceptionContextFactory exceptionContextFactory) { | ||
this.exceptionTraceSampler = Objects.requireNonNull(exceptionTraceSampler, "exceptionTraceSampler"); | ||
this.exceptionWrapperFactory = Objects.requireNonNull(exceptionWrapperFactory, "exceptionWrapperFactory"); | ||
this.exceptionContextFactory = Objects.requireNonNull(exceptionContextFactory, "exceptionContextFactory"); | ||
Check warning on line 39 in profiler/src/main/java/com/navercorp/pinpoint/profiler/context/exception/DefaultExceptionRecordingServiceFactory.java Codecov / codecov/patchprofiler/src/main/java/com/navercorp/pinpoint/profiler/context/exception/DefaultExceptionRecordingServiceFactory.java#L36-L39
|
||
|
||
} | ||
Check warning on line 41 in profiler/src/main/java/com/navercorp/pinpoint/profiler/context/exception/DefaultExceptionRecordingServiceFactory.java Codecov / codecov/patchprofiler/src/main/java/com/navercorp/pinpoint/profiler/context/exception/DefaultExceptionRecordingServiceFactory.java#L41
|
||
|
||
@Override | ||
public ExceptionRecordingService newService(TraceRoot traceRoot) { | ||
Objects.requireNonNull(traceRoot, "traceRoot"); | ||
ExceptionContext exceptionContext = this.exceptionContextFactory.newExceptionContext(traceRoot); | ||
return new DefaultExceptionRecordingService(exceptionTraceSampler, exceptionWrapperFactory, exceptionContext); | ||
Check warning on line 47 in profiler/src/main/java/com/navercorp/pinpoint/profiler/context/exception/DefaultExceptionRecordingServiceFactory.java Codecov / codecov/patchprofiler/src/main/java/com/navercorp/pinpoint/profiler/context/exception/DefaultExceptionRecordingServiceFactory.java#L45-L47
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2024 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.profiler.context.exception; | ||
|
||
import com.navercorp.pinpoint.profiler.context.exception.disabled.DisabledExceptionRecordingService; | ||
import com.navercorp.pinpoint.profiler.context.id.TraceRoot; | ||
|
||
public class DisableExceptionRecordingServiceFactory implements ExceptionRecordingServiceFactory { | ||
|
||
public static final ExceptionRecordingServiceFactory INSTANCE = new DisableExceptionRecordingServiceFactory(); | ||
|
||
public DisableExceptionRecordingServiceFactory() { | ||
} | ||
|
||
@Override | ||
public ExceptionRecordingService newService(TraceRoot traceRoot) { | ||
return DisabledExceptionRecordingService.INSTANCE; | ||
} | ||
} |