Author: keith
Date: Thu Apr 24 03:47:31 2008
New Revision: 16098

Log:

Avoid implementing constant interfaces as per code review


Modified:
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   Thu Apr 24 03:47:31 2008
@@ -21,7 +21,6 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.Deployer;
-import org.apache.axis2.deployment.DeploymentConstants;
 import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.deployment.DeploymentErrorMsgs;
 import org.apache.axis2.deployment.DeploymentException;
@@ -107,7 +106,7 @@
  * 
href="http://www.wso2.org/wiki/display/mashup/scripts+folder+structure+and+deployment";>
  * deployment folder structure</a>.
  */
-public class JSDeployer implements Deployer, DeploymentConstants, 
MashupConstants {
+public class JSDeployer implements Deployer {
 
     private static final Log log = LogFactory.getLog(JSDeployer.class);
 
@@ -528,6 +527,7 @@
                 String transportInName = transportIn.getName();
                 if (transportInName.equals("http")) {
                     needHttp = true;
+                    //todo
                 } else if (transportInName.equals("https")) {
                     needHttp = true;
                     prefix = WSDL2Constants.DEFAULT_HTTPS_PREFIX;
@@ -535,6 +535,7 @@
                     prefix = "JMS";
                 } else if (transportInName.equals("tcp")) {
                     prefix = "TCP";
+                    //todo use toUpperCase
                 } else if (transportInName.equals("SMTP")) {
                     prefix = "smtp";
                 } else if (transportInName.equals("XMPP")) {
@@ -922,13 +923,17 @@
 
         // Get the database connection details for the registry database from 
the server.xml
         String registryDriverClass = serverConfig
-                .getFirstProperty(REGISTRY_CONFIG + "." + DATABASE_CONNECTION 
+ "." + DRIVER_CLASS);
+                .getFirstProperty(MashupConstants.REGISTRY_CONFIG + "." + 
MashupConstants
+                        .DATABASE_CONNECTION + "." + 
MashupConstants.DRIVER_CLASS);
         String registryUrl = serverConfig
-                .getFirstProperty(REGISTRY_CONFIG + "." + DATABASE_CONNECTION 
+ "." + URL);
+                .getFirstProperty(MashupConstants.REGISTRY_CONFIG + "." + 
MashupConstants
+                        .DATABASE_CONNECTION + "." + MashupConstants.URL);
         String registryUsername = serverConfig
-                .getFirstProperty(REGISTRY_CONFIG + "." + DATABASE_CONNECTION 
+ "." + USERNAME);
+                .getFirstProperty(MashupConstants.REGISTRY_CONFIG + "." + 
MashupConstants
+                        .DATABASE_CONNECTION + "." + MashupConstants.USERNAME);
         String registryPassword = serverConfig
-                .getFirstProperty(REGISTRY_CONFIG + "." + DATABASE_CONNECTION 
+ "." + PASSWORD);
+                .getFirstProperty(MashupConstants.REGISTRY_CONFIG + "." + 
MashupConstants
+                        .DATABASE_CONNECTION + "." + MashupConstants.PASSWORD);
 
         if (registryDriverClass == null || "".equals(registryDriverClass) ||
                 registryUrl == null || "".equals(registryUrl)) {
@@ -939,13 +944,17 @@
         // Get the database connection details for the usermanager database 
from the server.xml
         String usermanagerDriverClass = serverConfig
                 .getFirstProperty(
-                        USERMANAGER_CONFIG + "." + DATABASE_CONNECTION + "." + 
DRIVER_CLASS);
+                        MashupConstants.USERMANAGER_CONFIG + "." + 
MashupConstants
+                                .DATABASE_CONNECTION + "." + 
MashupConstants.DRIVER_CLASS);
         String usermanagerUrl = serverConfig
-                .getFirstProperty(USERMANAGER_CONFIG + "." + 
DATABASE_CONNECTION + "." + URL);
+                .getFirstProperty(MashupConstants.USERMANAGER_CONFIG + "." + 
MashupConstants
+                        .DATABASE_CONNECTION + "." + MashupConstants.URL);
         String usermanagerUsername = serverConfig
-                .getFirstProperty(USERMANAGER_CONFIG + "." + 
DATABASE_CONNECTION + "." + USERNAME);
+                .getFirstProperty(MashupConstants.USERMANAGER_CONFIG + "." + 
MashupConstants
+                        .DATABASE_CONNECTION + "." + MashupConstants.USERNAME);
         String usermanagerPassword = serverConfig
-                .getFirstProperty(USERMANAGER_CONFIG + "." + 
DATABASE_CONNECTION + "." + PASSWORD);
+                .getFirstProperty(MashupConstants.USERMANAGER_CONFIG + "." + 
MashupConstants
+                        .DATABASE_CONNECTION + "." + MashupConstants.PASSWORD);
 
         if (usermanagerDriverClass == null || 
"".equals(usermanagerDriverClass) ||
                 usermanagerUrl == null || "".equals(usermanagerUrl)) {
@@ -1113,7 +1122,8 @@
 
             // Add the realm and registry as parameters in the 
AxisConfiguration so that they can be
             // used later on as an when needed
-            
configCtx.getAxisConfiguration().addParameter(RegistryConstants.REGISTRY, 
embeddedRegistry);
+            configCtx.getAxisConfiguration()
+                    .addParameter(RegistryConstants.REGISTRY, 
embeddedRegistry);
             
configCtx.getAxisConfiguration().addParameter(RegistryConstants.REGISTRY_REALM, 
realm);
 
             // Instantiating a secure registry using the system account, in 
order to create user
@@ -1210,7 +1220,8 @@
                         MashupConstants.CUSTOM_QUERY_PATH,
                         "SELECT DISTINCT A.PATH FROM RESOURCE A, TAG T WHERE " 
+
                                 "(A.PATH LIKE ? OR A.DESCRIPTION LIKE ? OR 
(T.TAG_NAME=? AND " +
-                                "T.RID=A.RID)) AND (A.MEDIA_TYPE='" + 
MashupConstants.MASHUP_MEDIA_TYPE +
+                                "T.RID=A.RID)) AND (A.MEDIA_TYPE='" + 
MashupConstants
+                                .MASHUP_MEDIA_TYPE +
                                 "' OR A.MEDIA_TYPE='wso2_data_service')",
                         RegistryConstants.RESOURCES_RESULT_TYPE
                 );

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to