KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > config > interceptor > ConfigurationInterceptor


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.interceptor;
19
20 import org.sape.carbon.core.component.ComponentConfiguration;
21 import org.sape.carbon.core.config.ConfigurationException;
22
23 /**
24  * Defines the methods exposed by the <code>ComponentProxy</code> that deal
25  * with the manipulation of a components configuration. Implementations of
26  * this interface need to support the notion of live vs. working
27  * configurations. Live configurations contain the settings that are
28  * currently in use by a component. Working configurations contain the
29  * settings that are in an intermediate and potentially invalid state.
30  * Working configurations become live configurations when applyConfiguration
31  * is called. They are thrown away when revertConfiguration is called.
32  *
33  * Copyright 2002 Sapient
34  * @since carbon 1.0
35  * @author Greg Hinkle, January 2002
36  * @version $Revision: 1.5 $($Author: dvoet $ / $Date: 2003/05/05 21:21:18 $)
37  */

38 public interface ConfigurationInterceptor {
39     /**
40      * Reverts the components live configuration back to its
41      * state as of the last call to persistConfiguration or the loading
42      * of the component if persistConfiguration was never called.
43      * The working configuration is discarded.
44      */

45     void revertConfiguration();
46
47     /**
48      * Makes the current working configuration live.
49      */

50     void applyConfiguration();
51
52     /**
53      * Persists the current live configuration in the Config Service.
54      *
55      * @throws ConfigurationException indictes an error persisting
56      * the configuration
57      */

58     void persistConfiguration() throws ConfigurationException;
59
60     /**
61      * Gets snapshot of the working copy of the component's configuration
62      *
63      * @return ComponentConfiguration the object implementing the component's
64      * configuration interface that represents the working copy of the
65      * component's configuration
66      */

67     ComponentConfiguration getWorkingConfiguration();
68
69     /**
70      * Gets snapshot of the live copy of the component's configuration
71      *
72      * @return ComponentConfiguration the object implementing the component's
73      * configuration interface that represents the live copy of the
74      * component's configuration
75      */

76     ComponentConfiguration getLiveConfiguration();
77
78     /**
79      * Same as revertConfiguration, but the configuration node containing
80      * this component's configuration is refreshed first.
81      */

82     void refreshConfiguration();
83 }
84
Popular Tags