Пример #1
0
 @Modified
 private void modified(ComponentContext context) {
   Boolean boolEnabled = Tools.isPropertyEnabled(context.getProperties(), "enabled");
   if (boolEnabled != null) {
     if (enabled && !boolEnabled) {
       enabled = false;
       disable();
     } else if (!enabled && boolEnabled) {
       enabled = true;
       enable();
     }
   }
 }
Пример #2
0
  /**
   * Extracts properties from the component configuration context.
   *
   * @param context the component context
   */
  private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    Boolean flag;

    flag = Tools.isPropertyEnabled(properties, "purgeOnDisconnection");
    if (flag == null) {
      log.info(
          "PurgeOnDisconnection is not configured, " + "using current value of {}",
          purgeOnDisconnection);
    } else {
      purgeOnDisconnection = flag;
      log.info(
          "Configured. PurgeOnDisconnection is {}", purgeOnDisconnection ? "enabled" : "disabled");
    }
  }