001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.geronimo.kernel.config;
017:
018: import org.apache.geronimo.kernel.repository.Artifact;
019:
020: import java.io.IOException;
021: import java.util.List;
022:
023: /**
024: *
025: *
026: *
027: * @version $Rev: 604483 $ $Date: 2007-12-15 10:28:19 -0800 (Sat, 15 Dec 2007) $
028: */
029: public interface PersistentConfigurationList {
030:
031: static final String PERSISTENT_CONFIGURATION_LIST = "PersistentConfigurationList";
032:
033: boolean isKernelFullyStarted();
034:
035: void setKernelFullyStarted(boolean kernelFullyStarted);
036:
037: void save() throws IOException;
038:
039: List<Artifact> restore() throws IOException;
040:
041: /**
042: * Adds a configuration to the list, but does not mark it as started.
043: */
044: void addConfiguration(Artifact configName);
045:
046: /**
047: * Indicates that the configuration should be started when the server is
048: * started. The configuration should have been previously added with
049: * addConfiguration.
050: */
051: void startConfiguration(Artifact configName);
052:
053: /**
054: * Indicates that the configuration should not be started when the
055: * server is started. The configuration should have been previously added
056: * with addConfiguration (and presumably started with startConfiguration).
057: */
058: void stopConfiguration(Artifact configName);
059:
060: /**
061: * Removes all record of the specified configuration from the configuration
062: * list. This is somewhat unusual -- normally you want to remember the
063: * settings in case the configuration is deployed again later.
064: */
065: void removeConfiguration(Artifact configName);
066:
067: /**
068: * Gets all configurations in the list matching the specified query,
069: * whether they are marked at starting or not.
070: *
071: * @param query The artifact to search for, normally not fully resolved
072: * so there may be multiple matches or matches that are not
073: * exactly equal to the argument.
074: *
075: * @return The matching artifacts that have data in the config list.
076: */
077: Artifact[] getListedConfigurations(Artifact query);
078:
079: /**
080: * Migrates settings from an old version of a configuration to a newer
081: * version of the configuration. Used when an updated version is deployed
082: * with a newer version number in the name, but the settings used for the
083: * previous version should be carried forward.
084: *
085: * @param oldName The name that the existing settings are under
086: * @param newName The name to move the settings to
087: * @param configuration The configuration itself, which can be used to
088: * verify that all the settings are still valid as
089: * they are migrated.
090: */
091: void migrateConfiguration(Artifact oldName, Artifact newName,
092: Configuration configuration);
093:
094: /**
095: * This method checks if there are any custom gbean attributes in the configuration.
096: *
097: * @param configName Name of the configuration
098: * @return true if the configuration contains any custom gbean attributes
099: */
100: boolean hasGBeanAttributes(Artifact configName);
101: }
|