Author: keith
Date: Mon Mar 24 22:58:48 2008
New Revision: 15052
Log:
Some code cleanup and throwing deployment exceptions
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/deployers/DBDeployer.java
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/deployers/DBDeployer.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/deployers/DBDeployer.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/deployers/DBDeployer.java
Mon Mar 24 22:58:48 2008
@@ -25,7 +25,6 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.AxisServiceGroup;
import org.apache.axis2.description.Parameter;
-import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.i18n.Messages;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,8 +43,6 @@
import org.wso2.registry.users.UserStoreException;
import org.wso2.registry.users.accesscontrol.AccessControlConstants;
import org.wso2.ws.dataservice.DBConstants;
-import org.wso2.ws.dataservice.DBMessageReceiver;
-import org.wso2.ws.dataservice.beans.Config;
import java.io.File;
import java.io.FileInputStream;
@@ -55,21 +52,17 @@
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
-import java.util.HashMap;
public class DBDeployer extends org.wso2.ws.dataservice.DBDeployer {
private static final Log log = LogFactory.getLog(DBDeployer.class);
-// private AxisConfiguration axisConfig;
-// private ConfigurationContext configCtx;
- private AxisService axisService = null;
public void init(ConfigurationContext configCtx) {
this.configCtx = configCtx;
axisConfig = this.configCtx.getAxisConfiguration();
}
- public void deploy(DeploymentFileData deploymentFileData) {
+ public void deploy(DeploymentFileData deploymentFileData) throws
DeploymentException{
StringWriter errorWriter = new StringWriter();
String serviceStatus = "";
try {
@@ -95,7 +88,7 @@
serviceStatus = "Error:\n" + errorWriter.toString();
MashupUtils.notifyMonitor("Deployment Error",
deploymentFileData.getName() +
" deployment failed", 1);
-// throw deploymentException;
+ throw deploymentException;
} catch (Throwable t) {
// Even though catching Throwable is not recomended, we do not want
// the server to fail on errors like NoClassDefFoundError
@@ -112,20 +105,17 @@
serviceStatus = "Error:\n" + errorWriter.toString();
MashupUtils.notifyMonitor("Error", deploymentFileData.getName() +
" deployment unsuccessful", 0);
-// throw new DeploymentException(t);
+ throw new DeploymentException(t);
} finally {
if (serviceStatus.startsWith("Error:")) {
axisConfig.getFaultyServices().put(deploymentFileData.getFile().getAbsolutePath(),
serviceStatus);
- try {
- populateRegistry(deploymentFileData,
- "This Service is Faulty. Reason : " +
serviceStatus,
- DescriptionBuilder.getShortFileName(
- deploymentFileData.getName()),
- true);
- } catch (DeploymentException e) {
- e.printStackTrace(); //To change body of catch statement
use File | Settings | File Templates.
- }
+ populateRegistry(deploymentFileData,
+ "This Service is Faulty. Reason : " +
serviceStatus,
+ DescriptionBuilder.getShortFileName(
+ deploymentFileData.getName()),
+ true);
+
}
}
@@ -135,8 +125,8 @@
AxisServiceGroup axisServiceGroup,
ConfigurationContext configCtx)
throws AxisFault {
- axisService = createDBService(currentFile.getAbsolutePath(),
- configCtx.getAxisConfiguration());
+ AxisService axisService =
createDBService(currentFile.getAbsolutePath(),
+
configCtx.getAxisConfiguration());
String name = axisService.getName();
MashupUtils.validateName(name, "ServiceName");
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev