KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > config > Configuration


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.config;
19
20 import org.jdom.Document;
21 import org.jdom.Element;
22
23 /**
24  * <p>This interface represents the base of a bit of configuration. Instances
25  * of this class will represent live configurations in the Carbon system.
26  * </p>
27  *
28  * Copyright 2001 Sapient
29  * @since carbon 1.0
30  * @author Greg Hinkle, December 2001
31  * @version $Revision: 1.23 $($Author: dvoet $ / $Date: 2003/05/05 21:21:15 $)
32  */

33 public interface Configuration {
34
35     /**
36      * <P>Returns the name of this configuration in the backing
37      * store, but may be null if the Configuration has not yet
38      * been saved to the backing store.
39      * </P>
40      * @return the fully-qualified path name of
41      * this Configuration in the backing store
42      */

43     String JavaDoc getConfigurationName();
44
45     /**
46      * Alters the name of this configuration document
47      * @param name the new name of this configuration document
48      */

49     void setConfigurationName(String JavaDoc name);
50
51     /**
52      * Returns a JDOM Document object representing the underlying data of this
53      * configuration object. Making direct changes to the data in this object
54      * may conflict with internal Carbon Core functionality.
55      * @return an {@link org.jdom.Document} object representing
56      * the full data set of this configuration
57      * document
58      */

59     Document getDataStructure();
60
61     /**
62      * For child documents, this provides access to the specific root element
63      * for the sub-document. This is the case for attached children data such
64      * as enclosed arrays or complex-types.
65      *
66      * @return the specific root element for the sub-document
67      */

68     Element getRootElement();
69
70     /**
71      * <P>
72      * This method makes a deep-copy of the underlying data
73      * structure for this configuration
74      * @return the newly created copy of configuration
75      */

76     Object JavaDoc clone();
77
78     /**
79      * This method returns the <code>Class</code> of this component's
80      * configuration.
81      *
82      * @return Class the class object for either an interface or a class that
83      * will hold the configuration representation for a Component.
84      */

85     Class JavaDoc getConfigurationInterface();
86
87     /**
88      * Is this configuration document writable or is it read-only. Shared cache
89      * instances of configuration objects should either be synchronized or
90      * marked not writable. When a configuration object is not writable, it
91      * should throw an exception if an attempt is made to modify it.
92      *
93      * @return true if this cofiguration object may be altered.
94      * @since carbon 1.1
95      */

96     boolean isConfigurationWritable();
97
98     /**
99      * Changes this config object to a read-only, thread-safe mode. This cannot
100      * be undone for this object. To get a writable version of this object,
101      * make a clone or fetch anew from the Configuration Service
102      *
103      * @since carbon 1.1
104      */

105     void setConfigurationReadOnly();
106
107
108 }
Popular Tags