Java Code Examples for org.apache.commons.configuration.event.ConfigurationEvent#getPropertyValue()

The following examples show how to use org.apache.commons.configuration.event.ConfigurationEvent#getPropertyValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConsulController.java    From james with Apache License 2.0 5 votes vote down vote up
private void onInformationPointAdded(ConfigurationEvent event, InformationPointService informationPointService) {
    String methodReference = readMethodReference(event);
    String informationPointDtoAsJsonString = (String) event.getPropertyValue();

    Optional<InformationPoint> informationPoint =
            InformationPointDTOParser.parse(informationPointDtoAsJsonString, methodReference);
    informationPoint.ifPresent(ip -> {
        informationPointService.addInformationPoint(ip);
        LOG.trace(() -> "Information point " + ip + " added");
    });
}
 
Example 2
Source File: ConsulController.java    From james with Apache License 2.0 5 votes vote down vote up
private void onInformationPointModified(ConfigurationEvent event, InformationPointService informationPointService) {
    String methodReference = readMethodReference(event);
    String informationPointDtoAsJsonString = (String) event.getPropertyValue();

    Optional<InformationPoint> informationPoint =
            InformationPointDTOParser.parse(informationPointDtoAsJsonString, methodReference);
    informationPoint.ifPresent(ip -> {
        informationPointService.removeInformationPoint(ip);
        informationPointService.addInformationPoint(ip);
        LOG.trace(() -> "Information point " + ip + " modified");
    });
}
 
Example 3
Source File: MarkAllFoundAction.java    From otroslogviewer with Apache License 2.0 5 votes vote down vote up
@Override
public void configurationChanged(ConfigurationEvent e) {
  if (e.getPropertyName() != null && e.getPropertyName().equalsIgnoreCase("gui.markColor")) {
    final Object propertyValue = e.getPropertyValue();
    if (propertyValue instanceof MarkerColors) {
      markerColors = (MarkerColors) propertyValue;
    } else if (propertyValue instanceof String) {
      String value = (String) propertyValue;
      markerColors = MarkerColors.fromString(value);
    }
  }
}
 
Example 4
Source File: ConfTest.java    From otroslogviewer with Apache License 2.0 5 votes vote down vote up
public void configurationChanged(ConfigurationEvent event) {
  if (!event.isBeforeUpdate()) {
    // only display events after the modification was done
    System.out.println(name + " Received event!");
    System.out.println(name + " Type = " + event.getType());
    if (event.getPropertyName() != null) {
      System.out.println(name + " Property name = " + event.getPropertyName());
    }
    if (event.getPropertyValue() != null) {
      System.out.println(name + " Property value = " + event.getPropertyValue());
    }
  }
}