KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > setup > LogSettingConfigItemListener


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.config.schema.setup;
5
6 import com.tc.config.schema.dynamic.ConfigItem;
7 import com.tc.config.schema.dynamic.ConfigItemListener;
8 import com.tc.logging.TCLogging;
9
10 import java.io.File JavaDoc;
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 JavaDoc oldValue, Object JavaDoc newValue) {
25     if (newValue != null) {
26       TCLogging.setLogDirectory((File JavaDoc) newValue, processType);
27     }
28   }
29
30 }
31
Popular Tags