Search in sources :

Example 1 with ValueAnnotationProcessor

use of com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor in project pinpoint by naver.

the class GrpcTransportConfig method read.

public void read(Properties properties) {
    ValueAnnotationProcessor reader = new ValueAnnotationProcessor();
    reader.process(this, properties);
    this.agentClientOption = readAgentClientOption(properties);
    // Metadata
    this.metadataClientOption = readMetadataClientOption(properties);
    // Stat
    this.statClientOption = readStatClientOption(properties);
    // Span
    this.spanClientOption = readSpanClientOption(properties);
    // Ssl
    SslOption sslOption = readSslOption(properties);
    this.sslOption = sslOption;
}
Also used : ValueAnnotationProcessor(com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption)

Example 2 with ValueAnnotationProcessor

use of com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor in project pinpoint by naver.

the class ProfilerConfigLoader method loadPropertyValues.

// for test
private static void loadPropertyValues(ProfilerConfig profilerConfig, Properties properties) {
    ValueAnnotationProcessor processor = new ValueAnnotationProcessor();
    processor.process(profilerConfig, properties);
}
Also used : ValueAnnotationProcessor(com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor)

Example 3 with ValueAnnotationProcessor

use of com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor in project pinpoint by naver.

the class GrpcTransportConfig method read.

public void read(Properties properties) {
    final ValueAnnotationProcessor reader = new ValueAnnotationProcessor();
    reader.process(this, properties);
}
Also used : ValueAnnotationProcessor(com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor)

Example 4 with ValueAnnotationProcessor

use of com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor in project pinpoint by naver.

the class ClientOptionTest method build.

@Test
public void build() {
    Properties properties = new Properties();
    properties.setProperty("keepalive.time.millis", "1");
    properties.setProperty("keepalive.timeout.millis", "2");
    properties.setProperty("flow-control.window.size", "65535");
    properties.setProperty("headers.size.max", "4");
    properties.setProperty("message.inbound.size.max", "5");
    properties.setProperty("connect.timeout.millis", "6");
    properties.setProperty("write.buffer.highwatermark", "7");
    properties.setProperty("write.buffer.lowwatermark", "8");
    ClientOption clientOption = new ClientOption();
    ValueAnnotationProcessor processor = new ValueAnnotationProcessor();
    processor.process(clientOption, properties);
    assertEquals(1, clientOption.getKeepAliveTime());
    assertEquals(2, clientOption.getKeepAliveTimeout());
    assertEquals(false, clientOption.isKeepAliveWithoutCalls());
    assertEquals(TimeUnit.DAYS.toMillis(30), clientOption.getIdleTimeoutMillis());
    assertEquals(65535, clientOption.getFlowControlWindow());
    assertEquals(4, clientOption.getMaxHeaderListSize());
    assertEquals(5, clientOption.getMaxInboundMessageSize());
    assertEquals(6, clientOption.getConnectTimeout());
    assertEquals(7, clientOption.getWriteBufferHighWaterMark());
    assertEquals(8, clientOption.getWriteBufferLowWaterMark());
}
Also used : ValueAnnotationProcessor(com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor) Properties(java.util.Properties) Test(org.junit.Test)

Example 5 with ValueAnnotationProcessor

use of com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor in project pinpoint by naver.

the class GrpcTransportConfig method readClientOption.

private ClientOption readClientOption(final Properties properties, final String transportName) {
    final ClientOption clientOption = new ClientOption();
    ValueAnnotationProcessor reader = new ValueAnnotationProcessor();
    reader.process(clientOption, new PropertyPlaceholderHelper.PlaceholderResolver() {

        @Override
        public String resolvePlaceholder(String placeholderName) {
            String prefix = transportName + placeholderName;
            return properties.getProperty(prefix);
        }
    });
    return clientOption;
}
Also used : PropertyPlaceholderHelper(com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper) ValueAnnotationProcessor(com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption)

Aggregations

ValueAnnotationProcessor (com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor)9 PropertyPlaceholderHelper (com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper)2 SslOption (com.navercorp.pinpoint.grpc.client.config.SslOption)2 Properties (java.util.Properties)2 Test (org.junit.Test)2 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)1