Author: keith
Date: Tue Mar 25 07:31:18 2008
New Revision: 15084
Log:
Fixing redeploy for DataServices
Modified:
trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupAdminService.java
Modified:
trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupAdminService.java
==============================================================================
---
trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupAdminService.java
(original)
+++
trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupAdminService.java
Tue Mar 25 07:31:18 2008
@@ -31,6 +31,8 @@
import org.wso2.registry.Resource;
import org.wso2.registry.jdbc.JDBCRegistry;
import org.wso2.utils.ServerConfiguration;
+import org.wso2.ws.dataservice.DBConstants;
+import org.wso2.wsas.ServerConstants;
import org.wso2.wsas.ServerManager;
import org.wso2.wsas.admin.service.ServiceAdmin;
import org.wso2.wsas.admin.service.util.ServiceMetaData;
@@ -162,7 +164,8 @@
}
public Boolean redeployService(String serviceName) throws MashupFault {
- boolean success = false;
+ boolean success;
+ File serviceFile = null;
MessageContext currentMessageContext =
MessageContext.getCurrentMessageContext();
AxisConfiguration configuration =
@@ -171,15 +174,27 @@
try {
AxisService mashupService = configuration.getService(serviceName);
- Parameter serviceJSParameter = mashupService
- .getParameter(JavaScriptEngineConstants.SERVICE_JS);
+ String serviceType =
+ (String)
mashupService.getParameterValue(ServerConstants.SERVICE_TYPE);
+ if (MashupConstants.MASHUP_JS_SERVICE.equals(serviceType)) {
+ Parameter serviceJSParameter = mashupService
+ .getParameter(JavaScriptEngineConstants.SERVICE_JS);
- if (serviceJSParameter != null && serviceJSParameter.getValue() !=
null) {
- File serviceJS = (File) serviceJSParameter.getValue();
- long time = System.currentTimeMillis();
- serviceJS.setLastModified(time);
- success = true;
+ if (serviceJSParameter != null &&
serviceJSParameter.getValue() != null) {
+ serviceFile = (File) serviceJSParameter.getValue();
+ }
+ } else {
+ Parameter serviceJSParameter = mashupService
+ .getParameter(DBConstants.DB_SERVICE_CONFIG_FILE);
+
+ if (serviceJSParameter != null &&
serviceJSParameter.getValue() != null) {
+ serviceFile = new File((String)
serviceJSParameter.getValue());
+ }
}
+
+ long time = System.currentTimeMillis();
+ serviceFile.setLastModified(time);
+ success = true;
} catch (AxisFault axisFault) {
throw new MashupFault("Cannot redeploy service " + serviceName,
axisFault);
}
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev