You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by az...@apache.org on 2007/05/28 14:30:48 UTC
svn commit: r542216 - in /webservices/axis2/trunk/java: etc/
modules/clustering/src/org/apache/axis2/clustering/context/
modules/clustering/src/org/apache/axis2/clustering/context/commands/
modules/clustering/src/org/apache/axis2/clustering/control/ mo...
Author: azeez
Date: Mon May 28 05:30:46 2007
New Revision: 542216
URL: http://svn.apache.org/viewvc?view=rev&rev=542216
Log:
1. Null checks
2. Added Javadocs
Modified:
webservices/axis2/trunk/java/etc/project.properties
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetStateResponseCommand.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java
Modified: webservices/axis2/trunk/java/etc/project.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/etc/project.properties?view=diff&rev=542216&r1=542215&r2=542216
==============================================================================
--- webservices/axis2/trunk/java/etc/project.properties (original)
+++ webservices/axis2/trunk/java/etc/project.properties Mon May 28 05:30:46 2007
@@ -74,9 +74,10 @@
modules/jaxws/project.xml,\
modules/jaxws-api/project.xml,\
modules/saaj-api/project.xml,\
-modules/saaj/project.xml
+modules/saaj/project.xml, \
+modules/clustering/project.xml
#modules/scripting/project.xml
-#modules/clustering/project.xml
+
# -------------------------------------------------------------------
# JUnit
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java?view=diff&rev=542216&r1=542215&r2=542216
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java Mon May 28 05:30:46 2007
@@ -34,16 +34,18 @@
public void updateProperties(AbstractContext abstractContext) {
log.debug("Updating props in " + abstractContext);
- for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) {
- String key = (String) iter.next();
- PropertyDifference propDiff =
- (PropertyDifference) properties.get(key);
- if (propDiff.isRemoved()) {
- abstractContext.removePropertyNonReplicable(key);
- } else { // it is updated/added
- abstractContext.setNonReplicableProperty(key, propDiff.getValue());
- log.debug("Added prop=" + key + ", value="+ propDiff.getValue() +
- " to context " + abstractContext);
+ if (abstractContext != null) {
+ for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) {
+ String key = (String) iter.next();
+ PropertyDifference propDiff =
+ (PropertyDifference) properties.get(key);
+ if (propDiff.isRemoved()) {
+ abstractContext.removePropertyNonReplicable(key);
+ } else { // it is updated/added
+ abstractContext.setNonReplicableProperty(key, propDiff.getValue());
+ log.debug("Added prop=" + key + ", value=" + propDiff.getValue() +
+ " to context " + abstractContext);
+ }
}
}
}
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java?view=diff&rev=542216&r1=542215&r2=542216
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java Mon May 28 05:30:46 2007
@@ -42,13 +42,15 @@
log.debug("Updating service context properties...");
ServiceGroupContext sgCtx =
configurationContext.getServiceGroupContext(serviceGroupContextId);
- try {
- AxisService axisService =
- configurationContext.getAxisConfiguration().getService(serviceName);
- ServiceContext serviceContext = sgCtx.getServiceContext(axisService, false);
- propertyUpdater.updateProperties(serviceContext);
- } catch (AxisFault e) {
- throw new ClusteringFault(e);
+ if (sgCtx != null) {
+ try {
+ AxisService axisService =
+ configurationContext.getAxisConfiguration().getService(serviceName);
+ ServiceContext serviceContext = sgCtx.getServiceContext(axisService, false);
+ propertyUpdater.updateProperties(serviceContext);
+ } catch (AxisFault e) {
+ throw new ClusteringFault(e);
+ }
}
}
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java?view=diff&rev=542216&r1=542215&r2=542216
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java Mon May 28 05:30:46 2007
@@ -34,7 +34,9 @@
public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
ServiceGroupContext sgCtx =
configurationContext.getServiceGroupContext(serviceGroupContextId);
- propertyUpdater.updateProperties(sgCtx);
+ if (sgCtx != null) {
+ propertyUpdater.updateProperties(sgCtx);
+ }
}
public int getCommandType() {
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetStateResponseCommand.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetStateResponseCommand.java?view=diff&rev=542216&r1=542215&r2=542216
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetStateResponseCommand.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetStateResponseCommand.java Mon May 28 05:30:46 2007
@@ -28,11 +28,14 @@
private ContextClusteringCommand[] commands;
public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
- configurationContext.
- setNonReplicableProperty(ClusteringConstants.CLUSTER_INITIALIZED, "true");
- if (commands != null) {
- for (int i = 0; i < commands.length; i++) {
- commands[i].execute(configurationContext);
+ if (configurationContext.
+ getPropertyNonReplicable(ClusteringConstants.CLUSTER_INITIALIZED) == null) {
+ configurationContext.
+ setNonReplicableProperty(ClusteringConstants.CLUSTER_INITIALIZED, "true");
+ if (commands != null) {
+ for (int i = 0; i < commands.length; i++) {
+ commands[i].execute(configurationContext);
+ }
}
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java?view=diff&rev=542216&r1=542215&r2=542216
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java Mon May 28 05:30:46 2007
@@ -23,11 +23,41 @@
public interface ClusterManager extends ParameterInclude {
+ /**
+ * Initialize the ClusteManager
+ *
+ * @throws ClusteringFault
+ */
public void init() throws ClusteringFault;
+
+ /**
+ *
+ * @return The ContextManager
+ */
public ContextManager getContextManager ();
+
+ /**
+ *
+ * @return The ConfigurationManager
+ */
public ConfigurationManager getConfigurationManager ();
+
+ /**
+ *
+ * @param contextManager
+ */
public void setContextManager (ContextManager contextManager);
+
+ /**
+ *
+ * @param configurationManager
+ */
public void setConfigurationManager (ConfigurationManager configurationManager);
+
+ /**
+ *
+ * @throws ClusteringFault
+ */
public void shutdown () throws ClusteringFault;
/**
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java?view=diff&rev=542216&r1=542215&r2=542216
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java Mon May 28 05:30:46 2007
@@ -26,16 +26,48 @@
public interface ContextManager extends ParameterInclude {
+ /**
+ * This method is called when a new {@link AbstractContext} is added to the system
+ *
+ * @param context
+ * @throws ClusteringFault
+ */
void addContext(AbstractContext context) throws ClusteringFault;
+ /**
+ * This method is called when a new {@link AbstractContext} is removed from the system
+ *
+ * @param context
+ * @throws ClusteringFault
+ */
void removeContext(AbstractContext context) throws ClusteringFault;
+ /**
+ * This method is called when properties in an {@link AbstractContext} are updated.
+ * This could be addition of new properties, modifications of existing properties or
+ * removal of properties.
+ *
+ * @param context
+ * @throws ClusteringFault
+ */
void updateContext(AbstractContext context) throws ClusteringFault;
+ /**
+ *
+ * @param context
+ * @return True - if the provided {@link AbstractContext} is clusterable
+ * @throws ClusteringFault
+ */
boolean isContextClusterable(AbstractContext context) throws ClusteringFault;
+ /**
+ * @param listener
+ */
void setContextManagerListener(ContextManagerListener listener);
+ /**
+ * @param configurationContext
+ */
void setConfigurationContext(ConfigurationContext configurationContext);
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org