Mercurial > stress-tester
changeset 699:c23df9582e50
refactoring
author | Devel 1 |
---|---|
date | Tue, 28 Nov 2017 11:08:29 +0100 |
parents | f248f2e25d10 |
children | 7955b2096163 |
files | stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilterAware.java stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFiltersConfigurator.java |
diffstat | 3 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java Mon Nov 27 14:23:02 2017 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java Tue Nov 28 11:08:29 2017 +0100 @@ -5,6 +5,7 @@ import com.passus.st.client.Client; import com.passus.st.client.Event; import com.passus.st.client.http.filter.HttpFilter; +import com.passus.st.client.http.filter.HttpFilterAware; import com.passus.st.client.http.filter.HttpFilterChain; import com.passus.st.emitter.Emitter; import com.passus.st.metric.MetricsContainer; @@ -17,7 +18,7 @@ * * @author Mirosław Hawrot */ -public class HttpClient implements Client { +public class HttpClient implements Client, HttpFilterAware { private static final Logger LOGGER = LogManager.getLogger(HttpClient.class); @@ -64,6 +65,7 @@ return filterChain; } + @Override public void addFilter(HttpFilter filter) { Assert.notNull(filter, "filter"); getFilterChain(true).addFilter(filter);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilterAware.java Tue Nov 28 11:08:29 2017 +0100 @@ -0,0 +1,10 @@ +package com.passus.st.client.http.filter; + +/** + * + * @author mikolaj.podbielski + */ +public interface HttpFilterAware { + + public void addFilter(HttpFilter filter); +}
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFiltersConfigurator.java Mon Nov 27 14:23:02 2017 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFiltersConfigurator.java Tue Nov 28 11:08:29 2017 +0100 @@ -11,7 +11,6 @@ import com.passus.config.schema.ConfigurationSchema; import com.passus.config.schema.ConfigurationSchemaImpl; import com.passus.config.validation.Errors; -import com.passus.st.client.http.HttpClient; import java.util.ArrayList; import java.util.List; import static com.passus.config.ConfigurationUtils.tupleNodeStringValue; @@ -28,9 +27,9 @@ private static final ConfigurationSchema SCHEMA = new ConfigurationSchemaImpl(new HttpFiltersNodeDefinitionCreator().create()); - private final HttpClient client; + private final HttpFilterAware client; - public HttpFiltersConfigurator(HttpClient client) { + public HttpFiltersConfigurator(HttpFilterAware client) { Assert.notNull(client, "client"); this.client = client; }