org.apache.axis2.clustering.context
Class DefaultContextManager

java.lang.Object
  extended by org.apache.axis2.clustering.context.DefaultContextManager
All Implemented Interfaces:
ContextManager, ParameterInclude

public class DefaultContextManager
extends java.lang.Object
implements ContextManager


Constructor Summary
DefaultContextManager()
           
 
Method Summary
 void addParameter(Parameter param)
          Method addParameter.
 void deserializeParameters(org.apache.axiom.om.OMElement parameterElement)
           
 Parameter getParameter(java.lang.String name)
          Method getParameter.
 java.util.ArrayList getParameters()
          Gets all the parameters in a given description.
 java.util.Map getReplicationExcludePatterns()
          Get all the excluded context property name patterns
 boolean isContextClusterable(AbstractContext context)
           
 boolean isParameterLocked(java.lang.String parameterName)
          Checks whether the parameter is locked at any level.
 void removeContext(AbstractContext context)
          This method is called when AbstractContext is removed from the system
 void removeParameter(Parameter param)
           
 void setConfigurationContext(ConfigurationContext configurationContext)
           
 void setContextManagerListener(ContextManagerListener listener)
           
 void setReplicationExcludePatterns(java.lang.String contextType, java.util.List patterns)
          All properties in the context with type contextType which have names that match the specified pattern will be excluded from replication.
 void setSender(ChannelSender sender)
           
 void updateContext(AbstractContext context)
          This method is called when properties in an AbstractContext are updated.
 void updateContext(AbstractContext context, java.lang.String[] propertyNames)
          This method is called when one need to update/replicate only certains properties in the specified context
 void updateContexts(AbstractContext[] contexts)
          This method is called when properties in a collection of AbstractContexts are updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultContextManager

public DefaultContextManager()
Method Detail

setSender

public void setSender(ChannelSender sender)

updateContext

public void updateContext(AbstractContext context)
                   throws ClusteringFault
Description copied from interface: ContextManager
This method is called when properties in an AbstractContext are updated. This could be addition of new properties, modifications of existing properties or removal of properties.

Specified by:
updateContext in interface ContextManager
Parameters:
context - The context to be replicated
Throws:
ClusteringFault - If replication fails

updateContext

public void updateContext(AbstractContext context,
                          java.lang.String[] propertyNames)
                   throws ClusteringFault
Description copied from interface: ContextManager
This method is called when one need to update/replicate only certains properties in the specified context

Specified by:
updateContext in interface ContextManager
Parameters:
context - The AbstractContext containing the properties to be replicated
propertyNames - The names of the specific properties that should be replicated
Throws:
ClusteringFault - If replication fails

updateContexts

public void updateContexts(AbstractContext[] contexts)
                    throws ClusteringFault
Description copied from interface: ContextManager
This method is called when properties in a collection of AbstractContexts are updated. This could be addition of new properties, modifications of existing properties or removal of properties.

Specified by:
updateContexts in interface ContextManager
Parameters:
contexts - The AbstractContexts containing the properties to be replicated
Throws:
ClusteringFault - If replication fails

removeContext

public void removeContext(AbstractContext context)
                   throws ClusteringFault
Description copied from interface: ContextManager
This method is called when AbstractContext is removed from the system

Specified by:
removeContext in interface ContextManager
Parameters:
context - The AbstractContext to be removed
Throws:
ClusteringFault - If context removal fails

isContextClusterable

public boolean isContextClusterable(AbstractContext context)
Specified by:
isContextClusterable in interface ContextManager
Parameters:
context - AbstractContext
Returns:
True - if the provided AbstractContext is clusterable

setContextManagerListener

public void setContextManagerListener(ContextManagerListener listener)
Specified by:
setContextManagerListener in interface ContextManager
Parameters:
listener - ContextManagerListener

setConfigurationContext

public void setConfigurationContext(ConfigurationContext configurationContext)
Specified by:
setConfigurationContext in interface ContextManager
Parameters:
configurationContext - ConfigurationContext

setReplicationExcludePatterns

public void setReplicationExcludePatterns(java.lang.String contextType,
                                          java.util.List patterns)
Description copied from interface: ContextManager
All properties in the context with type contextType which have names that match the specified pattern will be excluded from replication.

Generally, we can use the context class name as the context type.

Specified by:
setReplicationExcludePatterns in interface ContextManager
Parameters:
contextType - The type of the context such as org.apache.axis2.context.ConfigurationContext, org.apache.axis2.context.ServiceGroupContext & org.apache.axis2.context.ServiceContext. Also "defaults" is a special type, which will apply to all contexts
patterns - The patterns

getReplicationExcludePatterns

public java.util.Map getReplicationExcludePatterns()
Description copied from interface: ContextManager
Get all the excluded context property name patterns

Specified by:
getReplicationExcludePatterns in interface ContextManager
Returns:
All the excluded pattern of all the contexts. The key of the Map is the the contextType. See ContextManager.setReplicationExcludePatterns(String,List). The values are of type List of String Objects, which are a collection of patterns to be excluded.

addParameter

public void addParameter(Parameter param)
                  throws AxisFault
Description copied from interface: ParameterInclude
Method addParameter.

Specified by:
addParameter in interface ParameterInclude
Throws:
AxisFault

removeParameter

public void removeParameter(Parameter param)
                     throws AxisFault
Specified by:
removeParameter in interface ParameterInclude
Throws:
AxisFault

getParameter

public Parameter getParameter(java.lang.String name)
Description copied from interface: ParameterInclude
Method getParameter.

Specified by:
getParameter in interface ParameterInclude
Returns:
Returns Parameter.

getParameters

public java.util.ArrayList getParameters()
Description copied from interface: ParameterInclude
Gets all the parameters in a given description.

Specified by:
getParameters in interface ParameterInclude
Returns:
Returns ArrayList.

isParameterLocked

public boolean isParameterLocked(java.lang.String parameterName)
Description copied from interface: ParameterInclude
Checks whether the parameter is locked at any level.

Specified by:
isParameterLocked in interface ParameterInclude

deserializeParameters

public void deserializeParameters(org.apache.axiom.om.OMElement parameterElement)
                           throws AxisFault
Specified by:
deserializeParameters in interface ParameterInclude
Throws:
AxisFault


Copyright © 2007 Apache Web Services Project. All Rights Reserved.