001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019:
020: package org.apache.axis2.clustering.configuration;
021:
022: import org.apache.axis2.clustering.ClusteringFault;
023: import org.apache.axis2.context.ConfigurationContext;
024: import org.apache.axis2.description.ParameterInclude;
025:
026: public interface ConfigurationManager extends ParameterInclude {
027:
028: // ###################### Configuration management methods ##########################
029: /**
030: * Load a set of service groups
031: *
032: * @param serviceGroupNames The set of service groups to be loaded
033: * @throws ClusteringFault
034: */
035: void loadServiceGroups(String[] serviceGroupNames)
036: throws ClusteringFault;
037:
038: /**
039: * Unload a set of service groups
040: *
041: * @param serviceGroupNames The set of service groups to be unloaded
042: * @throws ClusteringFault
043: */
044: void unloadServiceGroups(String[] serviceGroupNames)
045: throws ClusteringFault;
046:
047: /**
048: * Apply a policy to a service
049: *
050: * @param serviceName The name of the service to which this policy needs to be applied
051: * @param policy The serialized policy to be applied to the service
052: * @throws ClusteringFault
053: */
054: void applyPolicy(String serviceName, String policy)
055: throws ClusteringFault;
056:
057: /**
058: * Reload the entire configuration of an Axis2 Node
059: *
060: * @throws ClusteringFault
061: */
062: void reloadConfiguration() throws ClusteringFault;
063:
064: // ###################### Transaction management methods ##########################
065:
066: /**
067: * First phase of the 2-phase commit protocol.
068: * Notifies a node that it needs to prepare to switch to a new configuration.
069: *
070: * @throws ClusteringFault
071: */
072: void prepare() throws ClusteringFault;
073:
074: /**
075: * Rollback whatever was done
076: *
077: * @throws ClusteringFault
078: */
079: void rollback() throws ClusteringFault;
080:
081: /**
082: * Second phase of the 2-phase commit protocol.
083: * Notifies a node that it needs to switch to a new configuration.
084: *
085: * @throws ClusteringFault
086: */
087: void commit() throws ClusteringFault;
088:
089: // ######################## General management methods ############################
090: /**
091: * To notify other nodes that an Exception occurred, during the processing
092: * of a {@link ConfigurationClusteringCommand}
093: *
094: * @param throwable The throwable which has to be propogated to other nodes
095: */
096: void exceptionOccurred(Throwable throwable) throws ClusteringFault;
097:
098: /**
099: * For registering a configuration event listener.
100: */
101: void setConfigurationManagerListener(
102: ConfigurationManagerListener listener);
103:
104: /**
105: * Set the configuration context
106: *
107: * @param configurationContext
108: */
109: void setConfigurationContext(
110: ConfigurationContext configurationContext);
111: }
|