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.context;
05:
06: import org.apache.xmlbeans.XmlException;
07: import org.apache.xmlbeans.XmlObject;
08:
09: import com.tc.config.schema.IllegalConfigurationChangeHandler;
10: import com.tc.config.schema.defaults.DefaultValueProvider;
11: import com.tc.config.schema.dynamic.BooleanConfigItem;
12: import com.tc.config.schema.dynamic.ConfigItem;
13: import com.tc.config.schema.dynamic.FileConfigItem;
14: import com.tc.config.schema.dynamic.IntConfigItem;
15: import com.tc.config.schema.dynamic.StringArrayConfigItem;
16: import com.tc.config.schema.dynamic.StringConfigItem;
17: import com.tc.config.schema.repository.BeanRepository;
18:
19: /**
20: * Binds together a {@link BeanRepository} and a {@link DefaultValueProvider}, and provides convenience methods for
21: * creating various items.
22: */
23: public interface ConfigContext {
24:
25: void ensureRepositoryProvides(Class theClass);
26:
27: boolean hasDefaultFor(String xpath) throws XmlException;
28:
29: XmlObject defaultFor(String xpath) throws XmlException;
30:
31: boolean isOptional(String xpath) throws XmlException;
32:
33: IllegalConfigurationChangeHandler illegalConfigurationChangeHandler();
34:
35: XmlObject bean();
36:
37: Object syncLockForBean();
38:
39: void itemCreated(ConfigItem item);
40:
41: IntConfigItem intItem(String xpath);
42:
43: StringConfigItem stringItem(String xpath);
44:
45: StringArrayConfigItem stringArrayItem(String xpath);
46:
47: FileConfigItem fileItem(String xpath);
48:
49: FileConfigItem substitutedFileItem(String xpath);
50:
51: FileConfigItem configRelativeSubstitutedFileItem(String xpath);
52:
53: BooleanConfigItem booleanItem(String xpath);
54:
55: BooleanConfigItem booleanItem(String xpath, boolean defaultValue);
56:
57: }
|