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.context;
021:
022: import org.apache.axis2.clustering.ClusteringFault;
023: import org.apache.axis2.context.AbstractContext;
024: import org.apache.axis2.context.ConfigurationContext;
025: import org.apache.axis2.description.ParameterInclude;
026:
027: import java.util.List;
028: import java.util.Map;
029:
030: public interface ContextManager extends ParameterInclude {
031:
032: /**
033: * This method is called when properties in an {@link AbstractContext} are updated.
034: * This could be addition of new properties, modifications of existing properties or
035: * removal of properties.
036: *
037: * @param context
038: * @return The UUID of the message that was sent to the group communications framework
039: * @throws ClusteringFault
040: */
041: String updateContext(AbstractContext context)
042: throws ClusteringFault;
043:
044: /**
045: * This method is called when properties in a collection of {@link AbstractContext}s are updated.
046: * This could be addition of new properties, modifications of existing properties or
047: * removal of properties.
048: *
049: * @param contexts
050: * @return The UUID of the message that was sent to the group communications framework
051: * @throws ClusteringFault
052: */
053: String updateContexts(AbstractContext[] contexts)
054: throws ClusteringFault;
055:
056: /**
057: * This method is called when a new {@link AbstractContext} is removed from the system
058: *
059: * @param context
060: * @return The UUID of the message that was sent to the group communications framework
061: * @throws ClusteringFault
062: */
063: String removeContext(AbstractContext context)
064: throws ClusteringFault;
065:
066: /**
067: * @param context
068: * @return True - if the provided {@link AbstractContext} is clusterable
069: */
070: boolean isContextClusterable(AbstractContext context);
071:
072: /**
073: * Indicates whether a particular message has been ACKed by all members of a cluster
074: *
075: * @param messageUniqueId
076: * @return true - if all memebers have ACKed the message with ID <code>messageUniqueId</code>
077: * false - otherwise
078: * @throws ClusteringFault
079: */
080: boolean isMessageAcknowledged(String messageUniqueId)
081: throws ClusteringFault;
082:
083: /**
084: * @param listener
085: */
086: void setContextManagerListener(ContextManagerListener listener);
087:
088: /**
089: * @param configurationContext
090: */
091: void setConfigurationContext(
092: ConfigurationContext configurationContext);
093:
094: /**
095: * All properties in the context with type <code>contextType</code> which have
096: * names that match the specified pattern will be excluded from replication.
097: * <p/>
098: * Generally, we can use the context class name as the context type.
099: *
100: * @param contextType
101: * @param patterns The patterns
102: */
103: void setReplicationExcludePatterns(String contextType, List patterns);
104:
105: /**
106: * Get all the excluded context property name patterns
107: *
108: * @return All the excluded pattern of all the contexts. The key of the Map is the
109: * the <code>contextType</code>. See {@link #setReplicationExcludePatterns(String,List)}.
110: * The values are of type {@link List} of {@link String} Objects,
111: * which are a collection of patterns to be excluded.
112: */
113: Map getReplicationExcludePatterns();
114: }
|