KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > NewCommonL1ConfigObject


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

5 package com.tc.config.schema;
6
7 import com.tc.config.schema.context.ConfigContext;
8 import com.tc.config.schema.dynamic.FileConfigItem;
9 import com.tc.util.Assert;
10 import com.terracottatech.config.Client;
11 import com.terracottatech.config.Modules;
12
13 /**
14  * The standard implementation of {@link NewCommonL1Config}.
15  */

16 public class NewCommonL1ConfigObject extends BaseNewConfigObject implements NewCommonL1Config {
17
18   private final FileConfigItem logsPath;
19   private final Modules modules;
20
21   public NewCommonL1ConfigObject(ConfigContext context) {
22     super(context);
23     Assert.assertNotNull(context);
24
25     this.context.ensureRepositoryProvides(Client.class);
26
27     logsPath = this.context.substitutedFileItem("logs");
28     final Client client = (Client) this.context.bean();
29     modules = client != null && client.isSetModules() ? client.getModules() : null;
30   }
31
32   public FileConfigItem logsPath() {
33     return this.logsPath;
34   }
35
36   public Modules modules() {
37     return modules;
38   }
39
40 }
41
Popular Tags