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/06/26 14:02:54 UTC
svn commit: r550781 - in /webservices/axis2/trunk/java/modules:
clustering/src/org/apache/axis2/clustering/context/
clustering/src/org/apache/axis2/clustering/context/commands/
kernel/src/org/apache/axis2/context/
Author: azeez
Date: Tue Jun 26 05:02:53 2007
New Revision: 550781
URL: http://svn.apache.org/viewvc?view=rev&rev=550781
Log:
Delete service group context functionality
Modified:
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/DeleteServiceGroupContextCommand.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java?view=diff&rev=550781&r1=550780&r2=550781
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java Tue Jun 26 05:02:53 2007
@@ -22,7 +22,6 @@
import org.apache.axis2.clustering.context.commands.UpdateServiceContextCommand;
import org.apache.axis2.clustering.context.commands.UpdateServiceGroupContextCommand;
import org.apache.axis2.clustering.context.commands.DeleteServiceGroupContextCommand;
-import org.apache.axis2.clustering.context.commands.DeleteServiceContextCommand;
import org.apache.axis2.clustering.tribes.AckManager;
import org.apache.axis2.context.AbstractContext;
import org.apache.axis2.context.ConfigurationContext;
@@ -213,20 +212,10 @@
ServiceGroupContext sgCtx = (ServiceGroupContext) abstractContext;
DeleteServiceGroupContextCommand cmd = new DeleteServiceGroupContextCommand();
cmd.setUniqueId(UUIDGenerator.getUUID());
- cmd.setServiceGroupName(sgCtx.getDescription().getServiceGroupName());
cmd.setServiceGroupContextId(sgCtx.getId());
return cmd;
- } else if (abstractContext instanceof ServiceContext) {
- ServiceContext serviceCtx = (ServiceContext) abstractContext;
- DeleteServiceContextCommand cmd = new DeleteServiceContextCommand();
- cmd.setUniqueId(UUIDGenerator.getUUID());
- cmd.setServiceGroupName(serviceCtx.getGroupName());
- cmd.setServiceGroupContextId(serviceCtx.getServiceGroupContext().getId());
- cmd.setServiceName(serviceCtx.getAxisService().getName());
-
- return cmd;
- }
+ }
return null;
}
}
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/DeleteServiceGroupContextCommand.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/DeleteServiceGroupContextCommand.java?view=diff&rev=550781&r1=550780&r2=550781
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/DeleteServiceGroupContextCommand.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/DeleteServiceGroupContextCommand.java Tue Jun 26 05:02:53 2007
@@ -16,25 +16,22 @@
package org.apache.axis2.clustering.context.commands;
import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ServiceGroupContext;
import org.apache.axis2.clustering.ClusteringFault;
import org.apache.axis2.clustering.context.ContextClusteringCommand;
+import org.apache.axis2.description.AxisServiceGroup;
/**
- *
+ *
*/
public class DeleteServiceGroupContextCommand extends ContextClusteringCommand {
- private String serviceGroupName;
private String serviceGroupContextId;
- public void setServiceGroupName(String serviceGroupName) {
- this.serviceGroupName = serviceGroupName;
- }
-
public void setServiceGroupContextId(String serviceGroupContextId) {
this.serviceGroupContextId = serviceGroupContextId;
}
public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
- // TODO: Implementation
+ configurationContext.removeServiceGroupContext(serviceGroupContextId);
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?view=diff&rev=550781&r1=550780&r2=550781
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java Tue Jun 26 05:02:53 2007
@@ -194,7 +194,7 @@
* </pre>
*
* @param messageContext : MessageContext
- * @throws org.apache.axis2.AxisFault : If something goes wrong
+ * @throws AxisFault : If something goes wrong
*/
public void fillServiceContextAndServiceGroupContext(MessageContext messageContext)
throws AxisFault {
@@ -296,7 +296,7 @@
*/
public void unregisterOperationContext(String key) {
synchronized (operationContextMap) {
- OperationContext opCtx = (OperationContext)operationContextMap.get(key);
+ OperationContext opCtx = (OperationContext) operationContextMap.get(key);
operationContextMap.remove(key);
contextRemoved(opCtx);
}
@@ -343,6 +343,7 @@
* Gets a OperationContext given a Message ID.
*
* @return Returns OperationContext <code>OperationContext<code>
+ * @param id
*/
public OperationContext getOperationContext(String id) {
OperationContext opCtx;
@@ -385,8 +386,7 @@
valueServiceName = value.getServiceName();
valueServiceGroupName = value.getServiceGroupName();
- if ((valueOperationName != null) && (valueOperationName.equals(operationName)))
- {
+ if ((valueOperationName != null) && (valueOperationName.equals(operationName))) {
if ((valueServiceName != null) && (valueServiceName.equals(serviceName))) {
if ((valueServiceGroupName != null) && (serviceGroupName != null)
&& (valueServiceGroupName.equals(serviceGroupName))) {
@@ -438,6 +438,7 @@
* Allows users to resolve the path relative to the root diretory.
*
* @param path
+ * @return
*/
public File getRealPath(String path) {
URL repository = axisConfiguration.getRepository();
@@ -505,12 +506,12 @@
int index = 0;
for (Iterator iter = serviceGroupContextMap.keySet().iterator(); iter.hasNext();) {
ids[index] = (String) iter.next();
- index ++;
+ index++;
}
for (Iterator iter = applicationSessionServiceGroupContexts.keySet().iterator();
iter.hasNext();) {
ids[index] = (String) iter.next();
- index ++;
+ index++;
}
return ids;
}
@@ -546,7 +547,8 @@
/**
* Sets the thread factory.
*
- * @param pool
+ * @param pool The thread pool
+ * @throws AxisFault If a thread pool has already been set
*/
public void setThreadPool(ThreadFactory pool) throws AxisFault {
if (threadPool == null) {
@@ -556,6 +558,21 @@
}
}
+ /**
+ * Remove a ServiceGroupContext
+ *
+ * @param serviceGroupContextId The ID of the ServiceGroupContext
+ */
+ public void removeServiceGroupContext(String serviceGroupContextId) {
+ if (serviceGroupContextMap == null) {
+ return;
+ }
+ ServiceGroupContext serviceGroupContext =
+ (ServiceGroupContext) serviceGroupContextMap.get(serviceGroupContextId);
+ serviceGroupContextMap.remove(serviceGroupContextId);
+ cleanupServiceContexts(serviceGroupContext);
+ }
+
private void cleanupServiceGroupContexts() {
if (serviceGroupContextMap == null) {
return;
@@ -736,4 +753,4 @@
public ConfigurationContext getRootContext() {
return this;
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org