use of org.springframework.beans.factory.annotation.Value in project pinpoint by naver.
the class FlinkConfiguration method log.
@PostConstruct
public void log() {
this.logger.info("{}", logger);
AnnotationVisitor<Value> annotationVisitor = new AnnotationVisitor<>(Value.class);
annotationVisitor.visit(this, new LoggingEvent(this.logger));
}
use of org.springframework.beans.factory.annotation.Value in project pinpoint by naver.
the class StatReceiverConfiguration method log.
@PostConstruct
public void log() {
logger.info("{}", this);
AnnotationVisitor<Value> visitor = new AnnotationVisitor<>(Value.class);
visitor.visit(this, new LoggingEvent(logger));
validate();
}
use of org.springframework.beans.factory.annotation.Value in project spring-framework by spring-projects.
the class ExpressionValueMethodArgumentResolver method createNamedValueInfo.
@Override
protected NamedValueInfo createNamedValueInfo(MethodParameter parameter) {
Value ann = parameter.getParameterAnnotation(Value.class);
Assert.state(ann != null, "No Value annotation");
return new ExpressionValueNamedValueInfo(ann);
}
use of org.springframework.beans.factory.annotation.Value in project spring-cloud-gateway by spring-cloud.
the class WebSocketIntegrationTests method customHeader.
@Test
public void customHeader() throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.add("my-header", "my-value");
MonoProcessor<Object> output = MonoProcessor.create();
client.execute(getUrl("/custom-header"), headers, session -> session.receive().map(WebSocketMessage::getPayloadAsText).subscribeWith(output).then()).block(Duration.ofMillis(5000));
assertEquals("my-header:my-value", output.block(Duration.ofMillis(5000)));
}
use of org.springframework.beans.factory.annotation.Value in project thingsboard by thingsboard.
the class TelemetryController method getTsKvListCallback.
private FutureCallback<List<TsKvEntry>> getTsKvListCallback(final DeferredResult<ResponseEntity> response, Boolean useStrictDataTypes) {
return new FutureCallback<>() {
@Override
public void onSuccess(List<TsKvEntry> data) {
Map<String, List<TsData>> result = new LinkedHashMap<>();
for (TsKvEntry entry : data) {
Object value = useStrictDataTypes ? getKvValue(entry) : entry.getValueAsString();
result.computeIfAbsent(entry.getKey(), k -> new ArrayList<>()).add(new TsData(entry.getTs(), value));
}
response.setResult(new ResponseEntity<>(result, HttpStatus.OK));
}
@Override
public void onFailure(Throwable e) {
log.error("Failed to fetch historical data", e);
AccessValidator.handleError(e, response, HttpStatus.INTERNAL_SERVER_ERROR);
}
};
}
Aggregations