View Javadoc

1   /**
2    *
3    *  Copyright 2004 The Apache Software Foundation
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   */
17  package org.apache.geronimo.kernel.config;
18  
19  import org.apache.geronimo.kernel.repository.Artifact;
20  
21  import java.io.IOException;
22  import java.util.List;
23  
24  /**
25   *
26   *
27   *
28   * @version $Rev: 399794 $ $Date: 2006-05-04 11:04:16 -0700 (Thu, 04 May 2006) $
29   */
30  public interface PersistentConfigurationList {
31  
32      static final String PERSISTENT_CONFIGURATION_LIST = "PersistentConfigurationList";
33      
34      boolean isKernelFullyStarted();
35  
36      void setKernelFullyStarted(boolean kernelFullyStarted);
37  
38      void save() throws IOException;
39  
40      List restore() throws IOException;
41  
42      /**
43       * Adds a configuration to the list, but does not mark it as started.
44       */
45      void addConfiguration(Artifact configName);
46  
47      /**
48       * Indicates that the configuration should be started when the server is
49       * started.  The configuration should have been previously added with
50       * addConfiguration.
51       */
52      void startConfiguration(Artifact configName);
53  
54      /**
55       * Indicates that the configuration should not be started when the
56       * server is started.  The configuration should have been previously added
57       * with addConfiguration (and presumably started with startConfiguration).
58       */
59      void stopConfiguration(Artifact configName);
60  
61      /**
62       * Removes all record of the specified configuration from the configuration
63       * list.  This is somewhat unusual -- normally you want to remember the
64       * settings in case the configuration is deployed again later.
65       */
66      void removeConfiguration(Artifact configName);
67  
68      /**
69       * Gets all configurations in the list matching the specified query,
70       * whether they are marked at starting or not.
71       * 
72       * @param query The artifact to search for, normally not fully resolved
73       *              so there may be multiple matches or matches that are not
74       *              exactly equal to the argument.
75       *
76       * @return The matching artifacts that have data in the config list.
77       */
78      Artifact[] getListedConfigurations(Artifact query);
79  
80      /**
81       * Migrates settings from an old version of a configuration to a newer
82       * version of the configuration.  Used when an updated version is deployed
83       * with a newer version number in the name, but the settings used for the
84       * previous version should be carried forward.
85       *
86       * @param oldName        The name that the existing settings are under
87       * @param newName        The name to move the settings to
88       * @param configuration  The configuration itself, which can be used to
89       *                       verify that all the settings are still valid as
90       *                       they are migrated.
91       */
92      void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration);
93  }