01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.config.schema.setup;
05:
06: import com.tc.config.schema.dynamic.ConfigItem;
07: import com.tc.config.schema.dynamic.ConfigItemListener;
08: import com.tc.logging.TCLogging;
09:
10: import java.io.File;
11:
12: /**
13: * Tells {@link TCLogging} to set its log file to the location specified. This must be attached to a {@link ConfigItem}
14: * that returns {@link File} objects.
15: */
16: public class LogSettingConfigItemListener implements ConfigItemListener {
17:
18: private final int processType;
19:
20: public LogSettingConfigItemListener(int processType) {
21: this .processType = processType;
22: }
23:
24: public void valueChanged(Object oldValue, Object newValue) {
25: if (newValue != null) {
26: TCLogging.setLogDirectory((File) newValue, processType);
27: }
28: }
29:
30: }
|