use of org.springframework.beans.factory.annotation.Value in project pinpoint by naver.
the class LoggingEvent method visit.
@Override
public void visit(Field field, Object value) {
if (logger.isDebugEnabled()) {
final Value annotation = field.getAnnotation(Value.class);
logger.debug("{} {} @Value(\"{}\") = {}", field.getType().getSimpleName(), field.getName(), annotation.value(), value);
}
}
use of org.springframework.beans.factory.annotation.Value in project pinpoint by naver.
the class AgentBaseDataReceiverConfiguration 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 pinpoint by naver.
the class SpanReceiverConfiguration method log.
@PostConstruct
public void log() {
logger.info("{}", this);
AnnotationVisitor<Value> visitor = new AnnotationVisitor<>(Value.class);
visitor.visit(this, new LoggingEvent(logger));
}
use of org.springframework.beans.factory.annotation.Value in project leopard by tanhaichao.
the class SysconfigBeanPostProcessor method update.
@Override
public boolean update() {
this.sysconfigDao.loadData();
for (FieldInfo fieldInfo : fieldList) {
Field field = fieldInfo.getField();
Value annotation = field.getAnnotation(Value.class);
Object value = resolveValue(annotation, field);
String sysconfigId = annotation.value().replace("${", "").replace("}", "");
logger.info("update sysconfigId:" + sysconfigId + " value:" + value);
if (value == null) {
throw new NullPointerException("参数值怎么会为空?");
}
try {
field.set(fieldInfo.getBean(), value);
} catch (IllegalAccessException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
lmodify = new Date();
return true;
}
use of org.springframework.beans.factory.annotation.Value in project vorto by eclipse.
the class ModelRepositoryController method getUserModels.
// ##################### Downloads ################################
@GetMapping(value = { "/mine/download" })
public void getUserModels(Principal principal, final HttpServletResponse response) {
List<ModelId> userModels = Lists.newArrayList();
User user = accountService.getUser(principal.getName());
Collection<Namespace> namespaces = null;
try {
namespaces = userNamespaceRoleService.getNamespaces(user, user);
} catch (OperationForbiddenException | DoesNotExistException e) {
LOGGER.error(e.getMessage(), e);
}
for (Namespace namespace : namespaces) {
IModelRepository modelRepo = getModelRepository(namespace.getWorkspaceId());
List<ModelInfo> modelInfos = modelRepo.search(String.format("author:%s", user.getUsername()));
List<ModelId> modelIds = modelInfos.stream().map(modelInfo -> modelInfo.getId()).collect(Collectors.toList());
userModels.addAll(modelIds);
}
LOGGER.info("Exporting information models for user - results: " + userModels.size());
sendAsZipFile(response, user.getUsername() + "-models.zip", getModelsAndDependencies(userModels));
}
Aggregations