LogSettingConfigItemListener.java :  » Net » Terracotta » com » tc » config » schema » setup » Java Open Source

Java Open Source » Net » Terracotta 
Terracotta » com » tc » config » schema » setup » LogSettingConfigItemListener.java
/*
 * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
 */
package com.tc.config.schema.setup;

import com.tc.config.schema.dynamic.ConfigItem;
import com.tc.config.schema.dynamic.ConfigItemListener;
import com.tc.logging.TCLogging;

import java.io.File;

/**
 * Tells {@link TCLogging} to set its log file to the location specified. This must be attached to a {@link ConfigItem}
 * that returns {@link File} objects.
 */
public class LogSettingConfigItemListener implements ConfigItemListener {

  private final int processType;

  public LogSettingConfigItemListener(int processType) {
    this.processType = processType;
  }

  public void valueChanged(Object oldValue, Object newValue) {
    if (newValue != null) {
      TCLogging.setLogDirectory((File) newValue, processType);
    }
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.